[
    {
        "hash": "826a06e9e36b29b43df25760ab9c0a9ccefc7056",
        "msg": "Dropped install_init_py file and generating __core_config__.py in order to detect whether we are in source or installatio directory.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-13T15:00:09+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T15:00:09+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "8d0801d77e7c168756bb1068a8f680a420f9b75f"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 21,
        "insertions": 0,
        "lines": 21,
        "files": 1,
        "dmm_unit_size": null,
        "dmm_unit_complexity": null,
        "dmm_unit_interfacing": null,
        "modified_files": [
            {
                "old_path": "scipy/install__init__py",
                "new_path": null,
                "filename": "install__init__py",
                "extension": "install__init__py",
                "change_type": "DELETE",
                "diff": "@@ -1,21 +0,0 @@\n-# -*- python -*-\n-\"\"\"SciPy Core\n-\n-You can support the development of SciPy by purchasing documentation at\n-\n-http://www.trelgol.com\n-\n-It is being distributed for a fee for a limited time to try and raise money for\n-development.\n-\"\"\"\n-\n-from scipy.base import *\n-import scipy.basic as basic\n-from scipy.basic.fft import fft, ifft\n-from scipy.basic.random import rand, randn\n-import scipy.basic.fft as fftpack\n-import scipy.basic.linalg as linalg\n-import scipy.basic.random as random\n-from core_version import version as __core_version__\n-from scipy.test.testing import ScipyTest\n-test = ScipyTest('scipy').test\n",
                "added_lines": 0,
                "deleted_lines": 21,
                "source_code": null,
                "source_code_before": "# -*- python -*-\n\"\"\"SciPy Core\n\nYou can support the development of SciPy by purchasing documentation at\n\nhttp://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise money for\ndevelopment.\n\"\"\"\n\nfrom scipy.base import *\nimport scipy.basic as basic\nfrom scipy.basic.fft import fft, ifft\nfrom scipy.basic.random import rand, randn\nimport scipy.basic.fft as fftpack\nimport scipy.basic.linalg as linalg\nimport scipy.basic.random as random\nfrom core_version import version as __core_version__\nfrom scipy.test.testing import ScipyTest\ntest = ScipyTest('scipy').test\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [],
                    "deleted": [
                        "# -*- python -*-",
                        "\"\"\"SciPy Core",
                        "",
                        "You can support the development of SciPy by purchasing documentation at",
                        "",
                        "http://www.trelgol.com",
                        "",
                        "It is being distributed for a fee for a limited time to try and raise money for",
                        "development.",
                        "\"\"\"",
                        "",
                        "from scipy.base import *",
                        "import scipy.basic as basic",
                        "from scipy.basic.fft import fft, ifft",
                        "from scipy.basic.random import rand, randn",
                        "import scipy.basic.fft as fftpack",
                        "import scipy.basic.linalg as linalg",
                        "import scipy.basic.random as random",
                        "from core_version import version as __core_version__",
                        "from scipy.test.testing import ScipyTest",
                        "test = ScipyTest('scipy').test"
                    ]
                }
            }
        ]
    },
    {
        "hash": "d6e2f6776d29f386c8c17adc88fa1920c31ee227",
        "msg": "Enabled scipy.distutils tests.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-13T15:06:00+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T15:06:00+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "826a06e9e36b29b43df25760ab9c0a9ccefc7056"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 1,
        "insertions": 12,
        "lines": 13,
        "files": 3,
        "dmm_unit_size": 1.0,
        "dmm_unit_complexity": 1.0,
        "dmm_unit_interfacing": 1.0,
        "modified_files": [
            {
                "old_path": "scipy/distutils/__init__.py",
                "new_path": "scipy/distutils/__init__.py",
                "filename": "__init__.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -4,3 +4,13 @@\n # customized CCompiler.spawn effective.\n import ccompiler\n import unixccompiler\n+\n+try:\n+    import __config__\n+    _INSTALLED = True\n+except ImportError:\n+    _INSTALLED = False\n+\n+if _INSTALLED:\n+    from scipy.test.testing import ScipyTest \n+    test = ScipyTest('scipy.distutils').test\n",
                "added_lines": 10,
                "deleted_lines": 0,
                "source_code": "\nfrom __version__ import version as __version__\n# Must import local ccompiler ASAP in order to get\n# customized CCompiler.spawn effective.\nimport ccompiler\nimport unixccompiler\n\ntry:\n    import __config__\n    _INSTALLED = True\nexcept ImportError:\n    _INSTALLED = False\n\nif _INSTALLED:\n    from scipy.test.testing import ScipyTest \n    test = ScipyTest('scipy.distutils').test\n",
                "source_code_before": "\nfrom __version__ import version as __version__\n# Must import local ccompiler ASAP in order to get\n# customized CCompiler.spawn effective.\nimport ccompiler\nimport unixccompiler\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 11,
                "complexity": 0,
                "token_count": 42,
                "diff_parsed": {
                    "added": [
                        "",
                        "try:",
                        "    import __config__",
                        "    _INSTALLED = True",
                        "except ImportError:",
                        "    _INSTALLED = False",
                        "",
                        "if _INSTALLED:",
                        "    from scipy.test.testing import ScipyTest",
                        "    test = ScipyTest('scipy.distutils').test"
                    ],
                    "deleted": []
                }
            },
            {
                "old_path": "scipy/distutils/setup.py",
                "new_path": "scipy/distutils/setup.py",
                "filename": "setup.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -7,6 +7,7 @@ def configuration(parent_package='',top_path=None):\n     config.add_subpackage('command')\n     config.add_subpackage('fcompiler')\n     config.add_data_dir('tests')\n+    config.make_config_py()\n     return config.todict()\n \n if __name__ == '__main__':\n",
                "added_lines": 1,
                "deleted_lines": 0,
                "source_code": "#!/usr/bin/env python\nfrom scipy.distutils.core      import setup\nfrom scipy.distutils.misc_util import Configuration\n\ndef configuration(parent_package='',top_path=None):\n    config = Configuration('distutils',parent_package,top_path)\n    config.add_subpackage('command')\n    config.add_subpackage('fcompiler')\n    config.add_data_dir('tests')\n    config.make_config_py()\n    return config.todict()\n\nif __name__ == '__main__':\n    setup(**configuration(top_path=''))\n",
                "source_code_before": "#!/usr/bin/env python\nfrom scipy.distutils.core      import setup\nfrom scipy.distutils.misc_util import Configuration\n\ndef configuration(parent_package='',top_path=None):\n    config = Configuration('distutils',parent_package,top_path)\n    config.add_subpackage('command')\n    config.add_subpackage('fcompiler')\n    config.add_data_dir('tests')\n    return config.todict()\n\nif __name__ == '__main__':\n    setup(**configuration(top_path=''))\n",
                "methods": [
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 50,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 5,
                        "end_line": 11,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 45,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 5,
                        "end_line": 10,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 50,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 5,
                        "end_line": 11,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 11,
                "complexity": 1,
                "token_count": 82,
                "diff_parsed": {
                    "added": [
                        "    config.make_config_py()"
                    ],
                    "deleted": []
                }
            },
            {
                "old_path": "scipy/distutils/tests/test_build_src.py",
                "new_path": "scipy/distutils/tests/test_misc_util.py",
                "filename": "test_misc_util.py",
                "extension": "py",
                "change_type": "RENAME",
                "diff": "@@ -1,5 +1,5 @@\n import sys\n-from scipy.base.testing import *\n+from scipy.test.testing import *\n from scipy.distutils.command.build_src import appendpath\n from os.path import join\n \n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "import sys\nfrom scipy.test.testing import *\nfrom scipy.distutils.command.build_src import appendpath\nfrom os.path import join\n\nclass test_appendpath(ScipyTestCase):\n\n    def check_1(self):\n        assert_equal(appendpath('prefix','name'),join('prefix','name'))\n        assert_equal(appendpath('/prefix','name'),join('/prefix','name'))\n        assert_equal(appendpath('/prefix','/name'),join('/prefix','name'))\n        assert_equal(appendpath('prefix','/name'),join('prefix','name'))\n\n    def check_2(self):\n        assert_equal(appendpath('prefix/sub','name'),\n                     join('prefix','sub','name'))\n        assert_equal(appendpath('prefix/sub','sup/name'),\n                     join('prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub','/prefix/name'),\n                     join('/prefix','sub','name'))\n\n    def check_3(self):\n        assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),\n                     join('/prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),\n                     join('/prefix','sub','sub2','sup','sup2','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),\n                     join('/prefix','sub','sub2','sup','name'))\n\nif __name__ == \"__main__\":\n    ScipyTest().run()\n",
                "source_code_before": "import sys\nfrom scipy.base.testing import *\nfrom scipy.distutils.command.build_src import appendpath\nfrom os.path import join\n\nclass test_appendpath(ScipyTestCase):\n\n    def check_1(self):\n        assert_equal(appendpath('prefix','name'),join('prefix','name'))\n        assert_equal(appendpath('/prefix','name'),join('/prefix','name'))\n        assert_equal(appendpath('/prefix','/name'),join('/prefix','name'))\n        assert_equal(appendpath('prefix','/name'),join('prefix','name'))\n\n    def check_2(self):\n        assert_equal(appendpath('prefix/sub','name'),\n                     join('prefix','sub','name'))\n        assert_equal(appendpath('prefix/sub','sup/name'),\n                     join('prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub','/prefix/name'),\n                     join('/prefix','sub','name'))\n\n    def check_3(self):\n        assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),\n                     join('/prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),\n                     join('/prefix','sub','sub2','sup','sup2','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),\n                     join('/prefix','sub','sub2','sup','name'))\n\nif __name__ == \"__main__\":\n    ScipyTest().run()\n",
                "methods": [
                    {
                        "name": "check_1",
                        "long_name": "check_1( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 69,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 8,
                        "end_line": 12,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_2",
                        "long_name": "check_2( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 61,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 14,
                        "end_line": 20,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_3",
                        "long_name": "check_3( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 71,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 22,
                        "end_line": 28,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    }
                ],
                "methods_before": [
                    {
                        "name": "check_1",
                        "long_name": "check_1( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 69,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 8,
                        "end_line": 12,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_2",
                        "long_name": "check_2( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 61,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 14,
                        "end_line": 20,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_3",
                        "long_name": "check_3( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 71,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 22,
                        "end_line": 28,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    }
                ],
                "changed_methods": [],
                "nloc": 26,
                "complexity": 3,
                "token_count": 248,
                "diff_parsed": {
                    "added": [
                        "from scipy.test.testing import *"
                    ],
                    "deleted": [
                        "from scipy.base.testing import *"
                    ]
                }
            }
        ]
    },
    {
        "hash": "c02b094be1621c9d5fb469e715c1f13ded6e3c6a",
        "msg": "Fixed typo.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-13T15:07:01+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T15:07:01+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "d6e2f6776d29f386c8c17adc88fa1920c31ee227"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/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": "scipy/distutils/tests/test_misc_util.py",
                "new_path": "scipy/distutils/tests/test_misc_util.py",
                "filename": "test_misc_util.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,6 +1,6 @@\n import sys\n from scipy.test.testing import *\n-from scipy.distutils.command.build_src import appendpath\n+from scipy.distutils.command.misc_util import appendpath\n from os.path import join\n \n class test_appendpath(ScipyTestCase):\n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "import sys\nfrom scipy.test.testing import *\nfrom scipy.distutils.command.misc_util import appendpath\nfrom os.path import join\n\nclass test_appendpath(ScipyTestCase):\n\n    def check_1(self):\n        assert_equal(appendpath('prefix','name'),join('prefix','name'))\n        assert_equal(appendpath('/prefix','name'),join('/prefix','name'))\n        assert_equal(appendpath('/prefix','/name'),join('/prefix','name'))\n        assert_equal(appendpath('prefix','/name'),join('prefix','name'))\n\n    def check_2(self):\n        assert_equal(appendpath('prefix/sub','name'),\n                     join('prefix','sub','name'))\n        assert_equal(appendpath('prefix/sub','sup/name'),\n                     join('prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub','/prefix/name'),\n                     join('/prefix','sub','name'))\n\n    def check_3(self):\n        assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),\n                     join('/prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),\n                     join('/prefix','sub','sub2','sup','sup2','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),\n                     join('/prefix','sub','sub2','sup','name'))\n\nif __name__ == \"__main__\":\n    ScipyTest().run()\n",
                "source_code_before": "import sys\nfrom scipy.test.testing import *\nfrom scipy.distutils.command.build_src import appendpath\nfrom os.path import join\n\nclass test_appendpath(ScipyTestCase):\n\n    def check_1(self):\n        assert_equal(appendpath('prefix','name'),join('prefix','name'))\n        assert_equal(appendpath('/prefix','name'),join('/prefix','name'))\n        assert_equal(appendpath('/prefix','/name'),join('/prefix','name'))\n        assert_equal(appendpath('prefix','/name'),join('prefix','name'))\n\n    def check_2(self):\n        assert_equal(appendpath('prefix/sub','name'),\n                     join('prefix','sub','name'))\n        assert_equal(appendpath('prefix/sub','sup/name'),\n                     join('prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub','/prefix/name'),\n                     join('/prefix','sub','name'))\n\n    def check_3(self):\n        assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),\n                     join('/prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),\n                     join('/prefix','sub','sub2','sup','sup2','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),\n                     join('/prefix','sub','sub2','sup','name'))\n\nif __name__ == \"__main__\":\n    ScipyTest().run()\n",
                "methods": [
                    {
                        "name": "check_1",
                        "long_name": "check_1( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 69,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 8,
                        "end_line": 12,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_2",
                        "long_name": "check_2( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 61,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 14,
                        "end_line": 20,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_3",
                        "long_name": "check_3( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 71,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 22,
                        "end_line": 28,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    }
                ],
                "methods_before": [
                    {
                        "name": "check_1",
                        "long_name": "check_1( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 69,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 8,
                        "end_line": 12,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_2",
                        "long_name": "check_2( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 61,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 14,
                        "end_line": 20,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_3",
                        "long_name": "check_3( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 71,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 22,
                        "end_line": 28,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    }
                ],
                "changed_methods": [],
                "nloc": 26,
                "complexity": 3,
                "token_count": 248,
                "diff_parsed": {
                    "added": [
                        "from scipy.distutils.command.misc_util import appendpath"
                    ],
                    "deleted": [
                        "from scipy.distutils.command.build_src import appendpath"
                    ]
                }
            }
        ]
    },
    {
        "hash": "08e7fa838c50279e797c3fbefb893f45e12cbc00",
        "msg": "Regenerated mtrand.c with a version of Pyrex which emits code that compiles with fewer warnings.",
        "author": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "committer": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "author_date": "2005-10-13T16:29:04+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T16:29:04+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "c02b094be1621c9d5fb469e715c1f13ded6e3c6a"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 413,
        "insertions": 382,
        "lines": 795,
        "files": 1,
        "dmm_unit_size": 0.8387096774193549,
        "dmm_unit_complexity": 0.7419354838709677,
        "dmm_unit_interfacing": 0.8064516129032258,
        "modified_files": [
            {
                "old_path": "scipy/corelib/mtrand/mtrand.c",
                "new_path": "scipy/corelib/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 Sun Oct  9 09:48:03 2005 */\n+/* Generated by Pyrex 0.9.3.1 on Thu Oct 13 12:12:52 2005 */\n \n #include \"Python.h\"\n #include \"structmember.h\"\n@@ -188,11 +188,11 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":124 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":125 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -201,7 +201,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":127 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -221,22 +221,20 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":128 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":129 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n     __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":130 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":131 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":132 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -270,11 +268,11 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":140 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":141 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -283,7 +281,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":143 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -303,22 +301,20 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":144 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":145 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n     __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":146 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":147 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":148 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -352,11 +348,11 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":157 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":158 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -365,7 +361,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":160 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -385,22 +381,20 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":161 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":162 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n     __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":163 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":164 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":165 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -434,11 +428,11 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":175 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":176 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -447,7 +441,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":178 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -467,22 +461,20 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":179 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":180 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n     __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":181 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":182 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":183 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -518,11 +510,11 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":191 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":192 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -531,7 +523,7 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":194 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -551,22 +543,20 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":195 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":196 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n     __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":197 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":198 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":199 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -600,11 +590,11 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":207 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":208 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -613,7 +603,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":210 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -633,22 +623,20 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":211 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":212 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n     __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":213 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":214 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":215 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -682,11 +670,11 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":224 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":225 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -695,7 +683,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":227 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -715,22 +703,20 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":228 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":229 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n     __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":230 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":231 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":232 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -764,11 +750,11 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":240 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":241 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -777,7 +763,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":243 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -797,22 +783,20 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":244 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":245 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n     __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":246 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":247 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n-      __pyx_L3:;\n     }\n-    __pyx_L4:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":248 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -841,37 +825,34 @@ static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n   long __pyx_v_i;\n   double __pyx_r;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":253 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n   __pyx_v_sum = (__pyx_v_darr[0]);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":254 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n   __pyx_v_c = 0.0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":255 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n   for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":256 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n     __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":257 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n     __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":258 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n     __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":259 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n     __pyx_v_sum = __pyx_v_t;\n-    __pyx_L2:;\n   }\n-  __pyx_L3:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":260 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\n   __pyx_r = __pyx_v_sum;\n   goto __pyx_L0;\n \n   __pyx_r = 0;\n   goto __pyx_L0;\n-  __pyx_L1:;\n   __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n   __pyx_L0:;\n   return __pyx_r;\n@@ -892,10 +873,10 @@ static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObje\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_seed);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":283 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n   ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":285 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_seed);\n@@ -924,18 +905,17 @@ static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n   int __pyx_1;\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":288 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n   __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":289 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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_L1:;\n   __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n   __pyx_L0:;\n   Py_DECREF(__pyx_v_self);\n@@ -963,11 +943,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_seed);\n   __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":303 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n   __pyx_1 = __pyx_v_seed == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":304 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\n     __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n     goto __pyx_L2;\n   }\n@@ -984,20 +964,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":306 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n     __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":308 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n     __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n     Py_DECREF(((PyObject *)__pyx_v_obj));\n     __pyx_v_obj = __pyx_3;\n     __pyx_3 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":309 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n     init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_obj->dimensions[0]));\n   }\n   __pyx_L2:;\n@@ -1034,7 +1014,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":318 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -1055,10 +1035,10 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\n   __pyx_v_state = ((PyObject *)__pyx_1);\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":319 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n   memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":320 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n   Py_INCREF(__pyx_n_MT19937);\n@@ -1115,7 +1095,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\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-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":331 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n   __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -1123,12 +1103,12 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   __pyx_v_algorithm_name = __pyx_2;\n   __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":332 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n   if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n   __pyx_3 = __pyx_3 != 0;\n   if (__pyx_3) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":333 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n     __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n     Py_INCREF(__pyx_k62p);\n@@ -1143,7 +1123,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":334 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n   __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n   __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n   Py_DECREF(__pyx_v_key);\n@@ -1156,17 +1136,17 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":335 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n   __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n   Py_DECREF(((PyObject *)__pyx_v_obj));\n   __pyx_v_obj = __pyx_4;\n   __pyx_4 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":336 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n   __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n   if (__pyx_3) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":337 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n     __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n     Py_INCREF(__pyx_k63p);\n@@ -1181,10 +1161,10 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   }\n   __pyx_L3:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":338 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n   memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":339 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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@@ -1214,7 +1194,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_se\n   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":343 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n   __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n@@ -1249,7 +1229,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_se\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_state);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":346 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_state);\n@@ -1288,7 +1268,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self\n   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":349 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -1338,7 +1318,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_s\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":357 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1368,7 +1348,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":364 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1419,38 +1399,38 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_size);\n   __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":379 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n   __pyx_1 = __pyx_v_high == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":380 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n     __pyx_v_lo = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":381 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n     __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n     __pyx_v_hi = __pyx_2;\n     goto __pyx_L2;\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":383 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n     __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n     __pyx_v_lo = __pyx_2;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":384 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n     __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n     __pyx_v_hi = __pyx_2;\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":386 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n   __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":387 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n   __pyx_1 = (__pyx_v_diff < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":388 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n     __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n     __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n     Py_INCREF(__pyx_k64p);\n@@ -1465,11 +1445,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   }\n   __pyx_L3:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":390 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":391 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; goto __pyx_L1;}\n     __pyx_r = __pyx_3;\n     __pyx_3 = 0;\n@@ -1478,7 +1458,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":393 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n     __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n     __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n@@ -1498,22 +1478,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n     __pyx_v_array = ((PyObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":394 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n     __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":395 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n     __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":396 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":397 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n       (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n-      __pyx_L5:;\n     }\n-    __pyx_L6:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":398 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n     Py_INCREF(((PyObject *)__pyx_v_array));\n     __pyx_r = ((PyObject *)__pyx_v_array);\n     goto __pyx_L0;\n@@ -1550,22 +1528,22 @@ static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyO\n   Py_INCREF(__pyx_v_self);\n   __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":406 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n   __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":407 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n   rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":408 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n   __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n   Py_DECREF(__pyx_v_bytestring);\n   __pyx_v_bytestring = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":409 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n   PyMem_Free(__pyx_v_bytes);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":410 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\n   Py_INCREF(__pyx_v_bytestring);\n   __pyx_r = __pyx_v_bytestring;\n   goto __pyx_L0;\n@@ -1598,7 +1576,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":417 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1621,7 +1599,7 @@ 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        randn(d0, d1, ..., dn) -> random values\\n        \";\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@@ -1640,7 +1618,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb\n   }\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":426 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_args);\n@@ -1655,7 +1633,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":427 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n     __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n@@ -1668,7 +1646,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":429 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n     __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n@@ -1719,7 +1697,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO\n   }\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":437 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_args);\n@@ -1734,7 +1712,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":438 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n     __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n@@ -1747,7 +1725,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":440 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n     Py_INCREF(__pyx_v_args);\n@@ -1797,16 +1775,16 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v\n   Py_INCREF(__pyx_v_high);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":449 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n   __pyx_1 = __pyx_v_high == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":450 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n     Py_INCREF(__pyx_v_low);\n     Py_DECREF(__pyx_v_high);\n     __pyx_v_high = __pyx_v_low;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":451 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n     __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;}\n     Py_DECREF(__pyx_v_low);\n     __pyx_v_low = __pyx_2;\n@@ -1815,7 +1793,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":452 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n   __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n   __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n   __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n@@ -1862,7 +1840,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":460 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1903,11 +1881,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":467 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n   __pyx_1 = (__pyx_v_scale <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":468 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n     Py_INCREF(__pyx_k66p);\n@@ -1922,7 +1900,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":469 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -1965,11 +1943,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":476 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":477 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n     Py_INCREF(__pyx_k67p);\n@@ -1985,7 +1963,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb\n   __pyx_1 = (__pyx_v_b <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":479 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n     Py_INCREF(__pyx_k68p);\n@@ -2000,7 +1978,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":480 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2041,11 +2019,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":487 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n   __pyx_1 = (__pyx_v_scale <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":488 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n     Py_INCREF(__pyx_k69p);\n@@ -2060,7 +2038,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":489 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2092,7 +2070,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":496 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -2130,11 +2108,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":503 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n   __pyx_1 = (__pyx_v_shape <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":504 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n     Py_INCREF(__pyx_k70p);\n@@ -2149,7 +2127,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":505 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2193,11 +2171,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":512 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n   __pyx_1 = (__pyx_v_shape <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":513 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n     Py_INCREF(__pyx_k71p);\n@@ -2213,7 +2191,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO\n   __pyx_1 = (__pyx_v_scale <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":515 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n     Py_INCREF(__pyx_k72p);\n@@ -2228,7 +2206,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":516 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2271,11 +2249,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":523 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n   __pyx_1 = (__pyx_v_dfnum <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":524 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n     Py_INCREF(__pyx_k73p);\n@@ -2291,7 +2269,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec\n   __pyx_1 = (__pyx_v_dfden <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":526 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n     Py_INCREF(__pyx_k74p);\n@@ -2306,7 +2284,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":527 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2352,11 +2330,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":534 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n   __pyx_1 = (__pyx_v_dfnum <= 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":535 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n     Py_INCREF(__pyx_k75p);\n@@ -2372,7 +2350,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   __pyx_1 = (__pyx_v_dfden <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":537 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n     Py_INCREF(__pyx_k76p);\n@@ -2388,7 +2366,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   __pyx_1 = (__pyx_v_nonc < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":539 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_k77p);\n@@ -2403,7 +2381,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":540 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2443,11 +2421,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":548 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n   __pyx_1 = (__pyx_v_df <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":549 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n     Py_INCREF(__pyx_k78p);\n@@ -2462,7 +2440,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":550 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2505,11 +2483,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":557 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n   __pyx_1 = (__pyx_v_df <= 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":558 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n     Py_INCREF(__pyx_k79p);\n@@ -2525,7 +2503,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__\n   __pyx_1 = (__pyx_v_nonc < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":560 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n     Py_INCREF(__pyx_k80p);\n@@ -2540,7 +2518,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":561 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2572,7 +2550,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":569 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -2610,11 +2588,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":576 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n   __pyx_1 = (__pyx_v_df <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":577 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n     Py_INCREF(__pyx_k81p);\n@@ -2629,7 +2607,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":578 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2670,11 +2648,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":586 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n   __pyx_1 = (__pyx_v_kappa < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":587 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n     Py_INCREF(__pyx_k82p);\n@@ -2689,7 +2667,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":588 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2729,11 +2707,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":595 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":596 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n     Py_INCREF(__pyx_k83p);\n@@ -2748,7 +2726,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":597 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2788,11 +2766,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":604 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":605 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n     Py_INCREF(__pyx_k84p);\n@@ -2807,7 +2785,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":606 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2847,11 +2825,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":613 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":614 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n     Py_INCREF(__pyx_k85p);\n@@ -2866,7 +2844,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":615 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2909,11 +2887,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":622 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":623 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n     Py_INCREF(__pyx_k86p);\n@@ -2928,7 +2906,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":624 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2971,11 +2949,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":631 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":632 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n     Py_INCREF(__pyx_k87p);\n@@ -2990,7 +2968,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":633 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3033,11 +3011,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":640 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":641 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n     Py_INCREF(__pyx_k88p);\n@@ -3052,7 +3030,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":642 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3095,11 +3073,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":654 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n   __pyx_1 = (__pyx_v_sigma <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":655 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n     Py_INCREF(__pyx_k89p);\n@@ -3114,7 +3092,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":656 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3155,11 +3133,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":663 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":664 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n     Py_INCREF(__pyx_k90p);\n@@ -3174,7 +3152,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":665 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3217,11 +3195,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":672 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n   __pyx_1 = (__pyx_v_mean <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":673 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n     Py_INCREF(__pyx_k91p);\n@@ -3237,7 +3215,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":675 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n     Py_INCREF(__pyx_k92p);\n@@ -3252,7 +3230,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":676 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3298,11 +3276,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":684 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n   __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":685 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n     Py_INCREF(__pyx_k93p);\n@@ -3318,7 +3296,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":687 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n     Py_INCREF(__pyx_k94p);\n@@ -3334,7 +3312,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   __pyx_1 = (__pyx_v_left == __pyx_v_right);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":689 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_k95p);\n@@ -3349,7 +3327,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":690 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3394,11 +3372,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":699 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n   __pyx_1 = (__pyx_v_n <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":700 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n     Py_INCREF(__pyx_k96p);\n@@ -3414,7 +3392,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":702 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n     Py_INCREF(__pyx_k97p);\n@@ -3430,7 +3408,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p > 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":704 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_k98p);\n@@ -3445,7 +3423,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":705 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3490,11 +3468,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":712 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n   __pyx_1 = (__pyx_v_n <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":713 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n     Py_INCREF(__pyx_k99p);\n@@ -3510,7 +3488,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   __pyx_1 = (__pyx_v_p < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":715 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n     Py_INCREF(__pyx_k100p);\n@@ -3526,7 +3504,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   __pyx_1 = (__pyx_v_p > 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":717 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_k101p);\n@@ -3541,7 +3519,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":718 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3582,11 +3560,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":726 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n   __pyx_1 = (__pyx_v_lam <= 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":727 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n     Py_INCREF(__pyx_k102p);\n@@ -3601,7 +3579,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":728 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3641,11 +3619,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":735 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n   __pyx_1 = (__pyx_v_a <= 1.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":736 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n     Py_INCREF(__pyx_k103p);\n@@ -3660,7 +3638,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":737 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3702,11 +3680,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":745 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n   __pyx_1 = (__pyx_v_p < 0.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":746 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n     Py_INCREF(__pyx_k104p);\n@@ -3722,7 +3700,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p > 1.0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":748 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n     Py_INCREF(__pyx_k105p);\n@@ -3737,7 +3715,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":749 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3785,11 +3763,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":761 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n   __pyx_1 = (__pyx_v_ngood < 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":762 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n     Py_INCREF(__pyx_k106p);\n@@ -3805,7 +3783,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   __pyx_1 = (__pyx_v_nbad < 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":764 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n     Py_INCREF(__pyx_k107p);\n@@ -3821,7 +3799,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":766 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_k108p);\n@@ -3837,7 +3815,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   __pyx_1 = (__pyx_v_nsample < 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":768 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_k109p);\n@@ -3852,7 +3830,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":769 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3894,11 +3872,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":777 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n   __pyx_1 = (__pyx_v_p < 0);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":778 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n     Py_INCREF(__pyx_k110p);\n@@ -3914,7 +3892,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p > 1);\n   if (__pyx_1) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":780 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n     Py_INCREF(__pyx_k111p);\n@@ -3929,7 +3907,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":781 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -4004,7 +3982,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n   __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":802 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -4018,7 +3996,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_mean = __pyx_3;\n   __pyx_3 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":803 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n   __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4032,11 +4010,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_cov = __pyx_2;\n   __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":804 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n   __pyx_4 = __pyx_v_size == Py_None;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":805 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n     __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; goto __pyx_L1;}\n     Py_DECREF(__pyx_v_shape);\n     __pyx_v_shape = __pyx_1;\n@@ -4045,14 +4023,14 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":807 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":808 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n   __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n   __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n@@ -4068,7 +4046,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":809 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n     __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n     Py_INCREF(__pyx_k112p);\n@@ -4083,7 +4061,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L3:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":810 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n   __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n@@ -4115,7 +4093,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":811 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n     __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n     Py_INCREF(__pyx_k113p);\n@@ -4130,7 +4108,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L4:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":812 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n   __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n   __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n@@ -4147,7 +4125,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":813 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n     Py_INCREF(__pyx_k114p);\n@@ -4162,7 +4140,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L5:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":815 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n   __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n   __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n@@ -4177,7 +4155,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":816 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n     __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n     Py_INCREF(__pyx_v_shape);\n     PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n@@ -4188,7 +4166,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L6:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":817 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n   __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n   __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n@@ -4201,7 +4179,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_final_shape = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":818 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n   __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n   __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n   __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n@@ -4216,7 +4194,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":822 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n   __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n   __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n@@ -4239,7 +4217,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_x = __pyx_5;\n   __pyx_5 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":823 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n   __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4278,7 +4256,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":833 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n   __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4305,7 +4283,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":834 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n   __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4332,7 +4310,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_x = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":837 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n   __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4348,7 +4326,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":838 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n   __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n   __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_final_shape);\n@@ -4359,7 +4337,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":839 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\n   Py_INCREF(__pyx_v_x);\n   __pyx_r = __pyx_v_x;\n   goto __pyx_L0;\n@@ -4428,7 +4406,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n   __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":857 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_pvals);\n@@ -4440,20 +4418,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   __pyx_v_d = __pyx_4;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":858 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n   __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n   Py_DECREF(((PyObject *)__pyx_v_parr));\n   __pyx_v_parr = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":859 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n   __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":861 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n   __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n   if (__pyx_5) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":862 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n     Py_INCREF(__pyx_k115p);\n@@ -4468,11 +4446,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":864 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n   __pyx_5 = __pyx_v_size == Py_None;\n   if (__pyx_5) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":865 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n     PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n@@ -4495,7 +4473,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_5) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":867 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n     Py_INCREF(__pyx_v_size);\n@@ -4509,7 +4487,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":869 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n     __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n     PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n@@ -4522,7 +4500,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   }\n   __pyx_L3:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":871 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -4541,71 +4519,68 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   __pyx_v_multin = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":872 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n   Py_INCREF(((PyObject *)__pyx_v_multin));\n   Py_DECREF(((PyObject *)__pyx_v_mnarr));\n   __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":873 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n   __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":874 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n   __pyx_v_i = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":875 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n   while (1) {\n-    __pyx_L4:;\n     __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n     if (!__pyx_5) break;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":876 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n     __pyx_v_Sum = 1.0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":877 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n     __pyx_v_dn = __pyx_v_n;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":878 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n     __pyx_4 = (__pyx_v_d - 1);\n     for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":879 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":880 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n       __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":881 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n       __pyx_5 = (__pyx_v_dn <= 0);\n       if (__pyx_5) {\n \n-        /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":882 */\n+        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n         goto __pyx_L7;\n         goto __pyx_L8;\n       }\n       __pyx_L8:;\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":883 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n       __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n-      __pyx_L6:;\n     }\n     __pyx_L7:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":884 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n     __pyx_5 = (__pyx_v_dn > 0);\n     if (__pyx_5) {\n \n-      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":885 */\n+      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\n       (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n       goto __pyx_L9;\n     }\n     __pyx_L9:;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":887 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n     __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n   }\n-  __pyx_L5:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":889 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\n   Py_INCREF(__pyx_v_multin);\n   __pyx_r = __pyx_v_multin;\n   goto __pyx_L0;\n@@ -4646,7 +4621,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_x);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":900 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_x);\n@@ -4662,16 +4637,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   __pyx_v_i = __pyx_4;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":901 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n   while (1) {\n-    __pyx_L2:;\n     __pyx_5 = (__pyx_v_i > 0);\n     if (!__pyx_5) break;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":902 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n     __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":903 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n     __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n     __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n     Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4687,10 +4661,9 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n     Py_DECREF(__pyx_3); __pyx_3 = 0;\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":904 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\n     __pyx_v_i = (__pyx_v_i - 1);\n   }\n-  __pyx_L3:;\n \n   __pyx_r = Py_None; Py_INCREF(__pyx_r);\n   goto __pyx_L0;\n@@ -4724,7 +4697,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   Py_INCREF(__pyx_v_x);\n   __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":912 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_x);\n@@ -4738,7 +4711,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_4) {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":913 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4755,7 +4728,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   }\n   /*else*/ {\n \n-    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":915 */\n+    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n     __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n     __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n     Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4771,7 +4744,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   }\n   __pyx_L2:;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":916 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_arr);\n@@ -4781,7 +4754,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":917 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\n   Py_INCREF(__pyx_v_arr);\n   __pyx_r = __pyx_v_arr;\n   goto __pyx_L0;\n@@ -4944,7 +4917,6 @@ static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a,\n }\n \n static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n-  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n   {\n     PyObject *etype, *eval, *etb;\n     PyErr_Fetch(&etype, &eval, &etb);\n@@ -4958,13 +4930,10 @@ static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n }\n \n static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n-  int e;\n-  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n   return 0;\n }\n \n static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n-  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n   return 0;\n }\n \n@@ -5157,503 +5126,503 @@ DL_EXPORT(void) initmtrand(void) {\n   if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n   __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":114 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n   import_array();\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":116 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n   __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n   if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":282 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n   Py_INCREF(Py_None);\n   __pyx_k2 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":291 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n   Py_INCREF(Py_None);\n   __pyx_k3 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":352 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n   Py_INCREF(Py_None);\n   __pyx_k4 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":359 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n   Py_INCREF(Py_None);\n   __pyx_k5 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":366 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n   Py_INCREF(Py_None);\n   __pyx_k6 = Py_None;\n   Py_INCREF(Py_None);\n   __pyx_k7 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":412 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n   __pyx_k8 = 0.0;\n   __pyx_k9 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k10 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":442 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n   Py_INCREF(Py_None);\n   __pyx_k11 = Py_None;\n   Py_INCREF(Py_None);\n   __pyx_k12 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":455 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n   Py_INCREF(Py_None);\n   __pyx_k13 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":462 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n   __pyx_k14 = 0.0;\n   __pyx_k15 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k16 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":471 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n   Py_INCREF(Py_None);\n   __pyx_k17 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":482 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n   __pyx_k18 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k19 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":491 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n   Py_INCREF(Py_None);\n   __pyx_k20 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":498 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n   Py_INCREF(Py_None);\n   __pyx_k21 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":507 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n   __pyx_k22 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k23 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":518 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n   Py_INCREF(Py_None);\n   __pyx_k24 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":529 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n   Py_INCREF(Py_None);\n   __pyx_k25 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":543 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n   Py_INCREF(Py_None);\n   __pyx_k26 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":552 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n   Py_INCREF(Py_None);\n   __pyx_k27 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":564 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n   Py_INCREF(Py_None);\n   __pyx_k28 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":571 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n   Py_INCREF(Py_None);\n   __pyx_k29 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":580 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n   Py_INCREF(Py_None);\n   __pyx_k30 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":590 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n   Py_INCREF(Py_None);\n   __pyx_k31 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":599 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n   Py_INCREF(Py_None);\n   __pyx_k32 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":608 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n   Py_INCREF(Py_None);\n   __pyx_k33 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":617 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n   __pyx_k34 = 0.0;\n   __pyx_k35 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k36 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":626 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n   __pyx_k37 = 0.0;\n   __pyx_k38 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k39 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":635 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n   __pyx_k40 = 0.0;\n   __pyx_k41 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k42 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":644 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n   __pyx_k43 = 0.0;\n   __pyx_k44 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k45 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":658 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n   __pyx_k46 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k47 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":667 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n   Py_INCREF(Py_None);\n   __pyx_k48 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":678 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n   Py_INCREF(Py_None);\n   __pyx_k49 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":694 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n   Py_INCREF(Py_None);\n   __pyx_k50 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":707 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n   Py_INCREF(Py_None);\n   __pyx_k51 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":721 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n   __pyx_k52 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k53 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":730 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n   Py_INCREF(Py_None);\n   __pyx_k54 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":739 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n   Py_INCREF(Py_None);\n   __pyx_k55 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":751 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n   Py_INCREF(Py_None);\n   __pyx_k56 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":772 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n   Py_INCREF(Py_None);\n   __pyx_k57 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":784 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n   Py_INCREF(Py_None);\n   __pyx_k58 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":841 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n   Py_INCREF(Py_None);\n   __pyx_k59 = Py_None;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":919 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n   __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":920 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":921 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":922 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":923 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":924 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":925 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":926 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":927 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":928 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":929 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":930 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":931 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":932 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":933 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":934 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":935 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":936 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":937 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":938 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":939 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":940 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":941 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":942 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":943 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":944 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":945 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":946 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":947 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":948 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":949 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":950 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":951 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":952 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":954 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":955 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":956 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":957 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":958 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":959 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":960 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":962 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":963 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":965 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":966 */\n+  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n",
                "added_lines": 382,
                "deleted_lines": 413,
                "source_code": "/* Generated by Pyrex 0.9.3.1 on Thu Oct 13 12:12:52 2005 */\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 \"scipy/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 int __Pyx_PrintItem(PyObject *); /*proto*/\nstatic int __Pyx_PrintNewline(void); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic void __Pyx_ReRaise(void); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic PyObject *__Pyx_GetExcValue(void); /*proto*/\nstatic int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/\nstatic int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*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_SetVtable(PyObject *dict, void *vtable); /*proto*/\nstatic int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/\nstatic PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*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_ArrayType = 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_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_scipy;\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n    Py_DECREF(((PyObject *)__pyx_v_obj));\n    __pyx_v_obj = __pyx_3;\n    __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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 *)__pyx_v_state));\n  __pyx_v_state = ((PyObject *)__pyx_1);\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n  Py_INCREF(__pyx_n_MT19937);\n  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n  Py_INCREF(((PyObject *)__pyx_v_state));\n  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_obj));\n  __pyx_v_obj = __pyx_4;\n  __pyx_4 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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 *__pyx_v_parr;\n  PyArrayObject *__pyx_v_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  double __pyx_v_prob;\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  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);\n  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_parr));\n  __pyx_v_parr = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)__pyx_v_mnarr));\n  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\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(__pyx_v_parr);\n  Py_DECREF(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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    if (*args2)\n        Py_XDECREF(*args2);\n    if (*kwds2)\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 <class>, <instance> */\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;\n  if (!(item = PySequence_GetItem(seq, i))) {\n    if (PyErr_ExceptionMatches(PyExc_IndexError))\n    \t__Pyx_UnpackError();\n  }\n  return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n  PyObject *item;\n  if (item = PySequence_GetItem(seq, i)) {\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 Sun Oct  9 09:48:03 2005 */\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 \"scipy/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 int __Pyx_PrintItem(PyObject *); /*proto*/\nstatic int __Pyx_PrintNewline(void); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic void __Pyx_ReRaise(void); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic PyObject *__Pyx_GetExcValue(void); /*proto*/\nstatic int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/\nstatic int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*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_SetVtable(PyObject *dict, void *vtable); /*proto*/\nstatic int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/\nstatic PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*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_ArrayType = 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_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_scipy;\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":132 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":148 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":165 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":182 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":183 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":199 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":215 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":231 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":232 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n      __pyx_L3:;\n    }\n    __pyx_L4:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":248 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n    __pyx_L2:;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":260 */\n  __pyx_r = __pyx_v_sum;\n  goto __pyx_L0;\n\n  __pyx_r = 0;\n  goto __pyx_L0;\n  __pyx_L1:;\n  __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n  __pyx_L0:;\n  return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_seed;\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":289 */\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_L1:;\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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n    Py_DECREF(((PyObject *)__pyx_v_obj));\n    __pyx_v_obj = __pyx_3;\n    __pyx_3 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":309 */\n    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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 *)__pyx_v_state));\n  __pyx_v_state = ((PyObject *)__pyx_1);\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n  Py_INCREF(__pyx_n_MT19937);\n  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n  Py_INCREF(((PyObject *)__pyx_v_state));\n  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_obj));\n  __pyx_v_obj = __pyx_4;\n  __pyx_4 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":339 */\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(__pyx_v_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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n      __pyx_L5:;\n    }\n    __pyx_L6:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":398 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":410 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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        randn(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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":807 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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 *__pyx_v_parr;\n  PyArrayObject *__pyx_v_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  double __pyx_v_prob;\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  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);\n  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_parr));\n  __pyx_v_parr = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)__pyx_v_mnarr));\n  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_L4:;\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":879 */\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      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n      __pyx_L6:;\n    }\n    __pyx_L7:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":885 */\n      (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n      goto __pyx_L9;\n    }\n    __pyx_L9:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n  __pyx_L5:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":889 */\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(__pyx_v_parr);\n  Py_DECREF(__pyx_v_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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_L2:;\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":904 */\n    __pyx_v_i = (__pyx_v_i - 1);\n  }\n  __pyx_L3:;\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)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  int e;\n  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n  return 0;\n}\n\nstatic int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_uniform); 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_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_rand); 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_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_randn); 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_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_integers); 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_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_normal); 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_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_normal); 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_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_beta); 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_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_exponential); 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_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_exponential); 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_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_gamma); 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_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_gamma); 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_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_f); 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_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_noncentral_f); 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_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_chisquare); 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_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_cauchy); 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_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_t); 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_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_vonmises); 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_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_pareto); 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_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_weibull); 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_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_power); 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_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_laplace); 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_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_gumbel); 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_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_logistic); 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_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_lognormal); 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_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_rayleigh); 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_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_wald); 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_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_triangular); 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_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_binomial); 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_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_negative_binomial); 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_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_poisson); 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_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_zipf); 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_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_geometric); 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_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_logseries); 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_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_multinomial); 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_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_shuffle); 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_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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    if (*args2)\n        Py_XDECREF(*args2);\n    if (*kwds2)\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 <class>, <instance> */\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;\n  if (!(item = PySequence_GetItem(seq, i))) {\n    if (PyErr_ExceptionMatches(PyExc_IndexError))\n    \t__Pyx_UnpackError();\n  }\n  return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n  PyObject *item;\n  if (item = PySequence_GetItem(seq, i)) {\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": 178,
                        "end_line": 256,
                        "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": 258,
                        "end_line": 336,
                        "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": 338,
                        "end_line": 416,
                        "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": 418,
                        "end_line": 496,
                        "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": 500,
                        "end_line": 578,
                        "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": 580,
                        "end_line": 658,
                        "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": 660,
                        "end_line": 738,
                        "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": 740,
                        "end_line": 818,
                        "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": 820,
                        "end_line": 859,
                        "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": 864,
                        "end_line": 901,
                        "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": 904,
                        "end_line": 922,
                        "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": 59,
                        "complexity": 10,
                        "token_count": 541,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 929,
                        "end_line": 998,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 1005,
                        "end_line": 1067,
                        "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": 88,
                        "complexity": 19,
                        "token_count": 969,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1079,
                        "end_line": 1185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 107,
                        "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": 1188,
                        "end_line": 1218,
                        "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": 1221,
                        "end_line": 1254,
                        "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": 1260,
                        "end_line": 1307,
                        "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": 1311,
                        "end_line": 1337,
                        "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": 1341,
                        "end_line": 1367,
                        "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": 996,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1375,
                        "end_line": 1516,
                        "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": 1520,
                        "end_line": 1561,
                        "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": 1565,
                        "end_line": 1595,
                        "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": 1603,
                        "end_line": 1679,
                        "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": 1683,
                        "end_line": 1756,
                        "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": 1760,
                        "end_line": 1829,
                        "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": 1833,
                        "end_line": 1859,
                        "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": 1867,
                        "end_line": 1921,
                        "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": 1931,
                        "end_line": 1999,
                        "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": 2007,
                        "end_line": 2059,
                        "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": 2063,
                        "end_line": 2089,
                        "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": 2097,
                        "end_line": 2148,
                        "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": 2158,
                        "end_line": 2227,
                        "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": 2237,
                        "end_line": 2305,
                        "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": 2317,
                        "end_line": 2402,
                        "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": 2410,
                        "end_line": 2461,
                        "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": 2471,
                        "end_line": 2539,
                        "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": 2543,
                        "end_line": 2569,
                        "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": 2577,
                        "end_line": 2628,
                        "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": 2636,
                        "end_line": 2688,
                        "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": 2696,
                        "end_line": 2747,
                        "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": 2755,
                        "end_line": 2806,
                        "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": 2814,
                        "end_line": 2865,
                        "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": 2873,
                        "end_line": 2927,
                        "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": 2935,
                        "end_line": 2989,
                        "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": 2997,
                        "end_line": 3051,
                        "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": 3059,
                        "end_line": 3113,
                        "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": 3121,
                        "end_line": 3173,
                        "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": 3183,
                        "end_line": 3251,
                        "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": 3263,
                        "end_line": 3348,
                        "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": 3360,
                        "end_line": 3444,
                        "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": 3456,
                        "end_line": 3540,
                        "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": 3548,
                        "end_line": 3600,
                        "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": 3608,
                        "end_line": 3659,
                        "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": 3669,
                        "end_line": 3736,
                        "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": 3750,
                        "end_line": 3851,
                        "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": 3861,
                        "end_line": 3928,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3955,
                        "end_line": 4366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 1729,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4376,
                        "end_line": 4605,
                        "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": 4609,
                        "end_line": 4680,
                        "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": 4686,
                        "end_line": 4775,
                        "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": 4913,
                        "end_line": 4917,
                        "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": 4919,
                        "end_line": 4930,
                        "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": 4932,
                        "end_line": 4934,
                        "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": 4936,
                        "end_line": 4938,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5114,
                        "end_line": 5636,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 66,
                        "complexity": 17,
                        "token_count": 324,
                        "parameters": [
                            "args",
                            "kwds",
                            "nargs",
                            "args2",
                            "kwds2"
                        ],
                        "start_line": 5646,
                        "end_line": 5715,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 5717,
                        "end_line": 5748,
                        "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": 5750,
                        "end_line": 5756,
                        "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": 5758,
                        "end_line": 5767,
                        "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": 5769,
                        "end_line": 5829,
                        "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": 5831,
                        "end_line": 5833,
                        "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": 45,
                        "parameters": [
                            "seq",
                            "i"
                        ],
                        "start_line": 5835,
                        "end_line": 5842,
                        "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": 5844,
                        "end_line": 5853,
                        "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": 5855,
                        "end_line": 5863,
                        "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": 5865,
                        "end_line": 5873,
                        "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": 5875,
                        "end_line": 5923,
                        "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": 5929,
                        "end_line": 5981,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 568,
                        "parameters": [
                            "rk_state",
                            "double",
                            "__pyx_v_size"
                        ],
                        "start_line": 178,
                        "end_line": 258,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 577,
                        "parameters": [
                            "rk_state",
                            "double",
                            "__pyx_v_size",
                            "__pyx_v_a"
                        ],
                        "start_line": 260,
                        "end_line": 340,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 586,
                        "parameters": [
                            "rk_state",
                            "double",
                            "__pyx_v_size",
                            "__pyx_v_a",
                            "__pyx_v_b"
                        ],
                        "start_line": 342,
                        "end_line": 422,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 595,
                        "parameters": [
                            "rk_state",
                            "double",
                            "__pyx_v_size",
                            "__pyx_v_a",
                            "__pyx_v_b",
                            "__pyx_v_c"
                        ],
                        "start_line": 424,
                        "end_line": 504,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 568,
                        "parameters": [
                            "rk_state",
                            "long",
                            "__pyx_v_size"
                        ],
                        "start_line": 508,
                        "end_line": 588,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 586,
                        "parameters": [
                            "rk_state",
                            "long",
                            "__pyx_v_size",
                            "__pyx_v_n",
                            "__pyx_v_p"
                        ],
                        "start_line": 590,
                        "end_line": 670,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 595,
                        "parameters": [
                            "rk_state",
                            "long",
                            "__pyx_v_size",
                            "__pyx_v_n",
                            "__pyx_v_m",
                            "__pyx_v_N"
                        ],
                        "start_line": 672,
                        "end_line": 752,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 64,
                        "complexity": 10,
                        "token_count": 577,
                        "parameters": [
                            "rk_state",
                            "long",
                            "__pyx_v_size",
                            "__pyx_v_a"
                        ],
                        "start_line": 754,
                        "end_line": 834,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 81,
                        "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": 26,
                        "complexity": 2,
                        "token_count": 130,
                        "parameters": [
                            "double",
                            "__pyx_v_n"
                        ],
                        "start_line": 836,
                        "end_line": 878,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 883,
                        "end_line": 920,
                        "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": 15,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "__pyx_v_self"
                        ],
                        "start_line": 923,
                        "end_line": 942,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "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": 59,
                        "complexity": 10,
                        "token_count": 541,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 949,
                        "end_line": 1018,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 1025,
                        "end_line": 1087,
                        "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": 88,
                        "complexity": 19,
                        "token_count": 969,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1099,
                        "end_line": 1205,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 107,
                        "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": 1208,
                        "end_line": 1238,
                        "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": 1241,
                        "end_line": 1274,
                        "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": 1280,
                        "end_line": 1327,
                        "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": 1331,
                        "end_line": 1357,
                        "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": 1361,
                        "end_line": 1387,
                        "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": 111,
                        "complexity": 19,
                        "token_count": 1002,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1395,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 1542,
                        "end_line": 1583,
                        "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": 1587,
                        "end_line": 1617,
                        "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": 1625,
                        "end_line": 1701,
                        "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": 1705,
                        "end_line": 1778,
                        "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": 1782,
                        "end_line": 1851,
                        "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": 1855,
                        "end_line": 1881,
                        "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": 1889,
                        "end_line": 1943,
                        "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": 1953,
                        "end_line": 2021,
                        "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": 2029,
                        "end_line": 2081,
                        "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": 2085,
                        "end_line": 2111,
                        "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": 2119,
                        "end_line": 2170,
                        "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": 2180,
                        "end_line": 2249,
                        "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": 2259,
                        "end_line": 2327,
                        "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": 2339,
                        "end_line": 2424,
                        "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": 2432,
                        "end_line": 2483,
                        "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": 2493,
                        "end_line": 2561,
                        "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": 2565,
                        "end_line": 2591,
                        "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": 2599,
                        "end_line": 2650,
                        "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": 2658,
                        "end_line": 2710,
                        "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": 2718,
                        "end_line": 2769,
                        "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": 2777,
                        "end_line": 2828,
                        "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": 2836,
                        "end_line": 2887,
                        "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": 2895,
                        "end_line": 2949,
                        "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": 2957,
                        "end_line": 3011,
                        "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": 3019,
                        "end_line": 3073,
                        "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": 3081,
                        "end_line": 3135,
                        "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": 3143,
                        "end_line": 3195,
                        "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": 3205,
                        "end_line": 3273,
                        "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": 3285,
                        "end_line": 3370,
                        "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": 3382,
                        "end_line": 3466,
                        "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": 3478,
                        "end_line": 3562,
                        "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": 3570,
                        "end_line": 3622,
                        "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": 3630,
                        "end_line": 3681,
                        "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": 3691,
                        "end_line": 3758,
                        "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": 3772,
                        "end_line": 3873,
                        "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": 3883,
                        "end_line": 3950,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3977,
                        "end_line": 4388,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 180,
                        "complexity": 35,
                        "token_count": 1738,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4398,
                        "end_line": 4630,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 233,
                        "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": 63,
                        "complexity": 18,
                        "token_count": 729,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4634,
                        "end_line": 4707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 74,
                        "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": 4713,
                        "end_line": 4802,
                        "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": 4940,
                        "end_line": 4944,
                        "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": 13,
                        "complexity": 2,
                        "token_count": 91,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 4946,
                        "end_line": 4958,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 5,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "o",
                            "v",
                            "a"
                        ],
                        "start_line": 4960,
                        "end_line": 4964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "__pyx_tp_clear_6mtrand_RandomState",
                        "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)",
                        "filename": "mtrand.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 23,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 4966,
                        "end_line": 4969,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmtrand",
                        "long_name": "initmtrand()",
                        "filename": "mtrand.c",
                        "nloc": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5145,
                        "end_line": 5667,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 66,
                        "complexity": 17,
                        "token_count": 324,
                        "parameters": [
                            "args",
                            "kwds",
                            "nargs",
                            "args2",
                            "kwds2"
                        ],
                        "start_line": 5677,
                        "end_line": 5746,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 5748,
                        "end_line": 5779,
                        "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": 5781,
                        "end_line": 5787,
                        "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": 5789,
                        "end_line": 5798,
                        "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": 5800,
                        "end_line": 5860,
                        "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": 5862,
                        "end_line": 5864,
                        "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": 45,
                        "parameters": [
                            "seq",
                            "i"
                        ],
                        "start_line": 5866,
                        "end_line": 5873,
                        "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": 5875,
                        "end_line": 5884,
                        "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": 5886,
                        "end_line": 5894,
                        "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": 5896,
                        "end_line": 5904,
                        "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": 5906,
                        "end_line": 5954,
                        "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": 5960,
                        "end_line": 6012,
                        "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": 3059,
                        "end_line": 3113,
                        "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": 1341,
                        "end_line": 1367,
                        "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": 338,
                        "end_line": 416,
                        "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": 5,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "o",
                            "v",
                            "a"
                        ],
                        "start_line": 4960,
                        "end_line": 4964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "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": 2873,
                        "end_line": 2927,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "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": 4686,
                        "end_line": 4775,
                        "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": 2063,
                        "end_line": 2089,
                        "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": 3263,
                        "end_line": 3348,
                        "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": 3669,
                        "end_line": 3736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 68,
                        "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": 740,
                        "end_line": 818,
                        "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": 1311,
                        "end_line": 1337,
                        "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": 13,
                        "complexity": 2,
                        "token_count": 91,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 4946,
                        "end_line": 4958,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 1260,
                        "end_line": 1307,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 23,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 4966,
                        "end_line": 4969,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "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": 2755,
                        "end_line": 2806,
                        "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": 1867,
                        "end_line": 1921,
                        "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": 1603,
                        "end_line": 1679,
                        "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": 3861,
                        "end_line": 3928,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 68,
                        "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": 88,
                        "complexity": 19,
                        "token_count": 969,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1079,
                        "end_line": 1185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 107,
                        "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": 904,
                        "end_line": 922,
                        "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": 2097,
                        "end_line": 2148,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "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": 258,
                        "end_line": 336,
                        "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": 3548,
                        "end_line": 3600,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1188,
                        "end_line": 1218,
                        "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": 820,
                        "end_line": 859,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "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": 2410,
                        "end_line": 2461,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "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": 3456,
                        "end_line": 3540,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 85,
                        "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": 2997,
                        "end_line": 3051,
                        "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": 2577,
                        "end_line": 2628,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3955,
                        "end_line": 4366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 1683,
                        "end_line": 1756,
                        "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": 996,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1375,
                        "end_line": 1516,
                        "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": 1565,
                        "end_line": 1595,
                        "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": 1760,
                        "end_line": 1829,
                        "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": 660,
                        "end_line": 738,
                        "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": 1833,
                        "end_line": 1859,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "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": 3183,
                        "end_line": 3251,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5114,
                        "end_line": 5636,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 500,
                        "end_line": 578,
                        "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": 2636,
                        "end_line": 2688,
                        "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": 580,
                        "end_line": 658,
                        "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": 2237,
                        "end_line": 2305,
                        "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": 4609,
                        "end_line": 4680,
                        "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": 1221,
                        "end_line": 1254,
                        "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": 2158,
                        "end_line": 2227,
                        "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": 2543,
                        "end_line": 2569,
                        "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": 1729,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4376,
                        "end_line": 4605,
                        "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": 2814,
                        "end_line": 2865,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "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": 59,
                        "complexity": 10,
                        "token_count": 541,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 929,
                        "end_line": 998,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 3360,
                        "end_line": 3444,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 85,
                        "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": 3608,
                        "end_line": 3659,
                        "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": 864,
                        "end_line": 901,
                        "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": 1931,
                        "end_line": 1999,
                        "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": 3121,
                        "end_line": 3173,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 2007,
                        "end_line": 2059,
                        "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": 2317,
                        "end_line": 2402,
                        "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": 2935,
                        "end_line": 2989,
                        "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": 2471,
                        "end_line": 2539,
                        "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": 1520,
                        "end_line": 1561,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 42,
                        "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": 3750,
                        "end_line": 3851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 102,
                        "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": 178,
                        "end_line": 256,
                        "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": 1005,
                        "end_line": 1067,
                        "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": 418,
                        "end_line": 496,
                        "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": 2696,
                        "end_line": 2747,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 4964,
                "complexity": 906,
                "token_count": 47915,
                "diff_parsed": {
                    "added": [
                        "/* Generated by Pyrex 0.9.3.1 on Thu Oct 13 12:12:52 2005 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */",
                        "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        \";",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":539 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":689 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":704 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":717 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":766 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":768 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":813 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */",
                        "        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":925 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":926 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":927 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":928 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":929 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":930 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":931 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":932 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":933 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":934 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":935 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":936 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":937 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":938 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":939 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":940 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":941 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":942 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":943 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":944 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":945 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":946 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":947 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":948 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":949 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":950 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":951 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":952 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":954 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":955 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":956 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":957 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":958 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":960 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":962 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":963 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":965 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":966 */"
                    ],
                    "deleted": [
                        "/* Generated by Pyrex 0.9.3.1 on Sun Oct  9 09:48:03 2005 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":124 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":125 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":127 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":128 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":129 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":130 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":131 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":132 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":140 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":141 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":143 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":144 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":145 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":146 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":147 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":148 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":157 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":158 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":160 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":161 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":162 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":163 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":164 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":165 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":175 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":176 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":178 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":179 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":180 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":181 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":182 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":183 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":191 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":192 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":194 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":195 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":196 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":197 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":198 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":199 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":207 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":208 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":210 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":211 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":212 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":213 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":214 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":215 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":224 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":225 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":227 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":228 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":229 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":230 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":231 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":232 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":240 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":241 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":243 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":244 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":245 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":246 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":247 */",
                        "      __pyx_L3:;",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":248 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":253 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":254 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":255 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":256 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":257 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":258 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":259 */",
                        "    __pyx_L2:;",
                        "  __pyx_L3:;",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":260 */",
                        "  __pyx_L1:;",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":283 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":285 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":288 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":289 */",
                        "  __pyx_L1:;",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":303 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":304 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":306 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":308 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":309 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":318 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":319 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":320 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":331 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":332 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":333 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":334 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":335 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":336 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":337 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":338 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":339 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":343 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":346 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":349 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":357 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":364 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":379 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":380 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":381 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":383 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":384 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":386 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":387 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":388 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":390 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":391 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":393 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":394 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":395 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":396 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":397 */",
                        "      __pyx_L5:;",
                        "    __pyx_L6:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":398 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":406 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":407 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":408 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":409 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":410 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":417 */",
                        "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        randn(d0, d1, ..., dn) -> random values\\n        \";",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":426 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":427 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":429 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":437 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":438 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":440 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":449 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":450 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":451 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":452 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":460 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":467 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":468 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":469 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":476 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":477 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":479 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":480 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":487 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":488 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":489 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":496 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":503 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":504 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":505 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":512 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":513 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":515 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":516 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":523 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":524 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":526 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":527 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":534 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":535 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":537 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":539 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":540 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":548 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":549 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":550 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":557 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":558 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":560 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":561 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":569 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":576 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":577 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":578 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":586 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":587 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":588 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":595 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":596 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":597 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":604 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":605 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":606 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":613 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":614 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":615 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":622 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":623 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":624 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":631 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":632 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":633 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":640 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":641 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":642 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":654 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":655 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":656 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":663 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":664 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":665 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":672 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":673 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":675 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":676 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":684 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":685 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":687 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":689 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":690 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":699 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":700 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":702 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":704 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":705 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":712 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":713 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":715 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":717 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":718 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":726 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":727 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":728 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":735 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":736 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":737 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":745 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":746 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":748 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":749 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":761 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":762 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":764 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":766 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":768 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":769 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":777 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":778 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":780 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":781 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":802 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":803 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":804 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":805 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":807 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":808 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":809 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":810 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":811 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":812 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":813 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":815 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":816 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":817 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":818 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":822 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":823 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":833 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":834 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":837 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":838 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":839 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":857 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":858 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":859 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":861 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":862 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":864 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":865 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":867 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":869 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":871 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":872 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":873 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":874 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":875 */",
                        "    __pyx_L4:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":876 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":877 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":878 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":879 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":880 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":881 */",
                        "        /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":882 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":883 */",
                        "      __pyx_L6:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":884 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":885 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":887 */",
                        "  __pyx_L5:;",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":889 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":900 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":901 */",
                        "    __pyx_L2:;",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":902 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":903 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":904 */",
                        "  __pyx_L3:;",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":912 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":913 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":915 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":916 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":917 */",
                        "  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;",
                        "  int e;",
                        "  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;",
                        "  struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":114 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":116 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":282 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":291 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":352 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":359 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":366 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":412 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":442 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":455 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":462 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":471 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":482 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":491 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":498 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":507 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":518 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":529 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":543 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":552 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":564 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":571 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":580 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":590 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":599 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":608 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":617 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":626 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":635 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":644 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":658 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":667 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":678 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":694 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":707 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":721 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":730 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":739 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":751 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":772 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":784 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":841 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":919 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":920 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":921 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":922 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":923 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":924 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":925 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":926 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":927 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":928 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":929 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":930 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":931 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":932 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":933 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":934 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":935 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":936 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":937 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":938 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":939 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":940 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":941 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":942 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":943 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":944 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":945 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":946 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":947 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":948 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":949 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":950 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":951 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":952 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":954 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":955 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":956 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":957 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":958 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":959 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":960 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":962 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":963 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":965 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":966 */"
                    ]
                }
            }
        ]
    },
    {
        "hash": "4d9e46d48de3ce4039ce5ebe5433eab339067b98",
        "msg": "Fixed typo.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-13T21:25:31+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T21:25:31+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "08e7fa838c50279e797c3fbefb893f45e12cbc00"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/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": "scipy/distutils/tests/test_misc_util.py",
                "new_path": "scipy/distutils/tests/test_misc_util.py",
                "filename": "test_misc_util.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,6 +1,6 @@\n import sys\n from scipy.test.testing import *\n-from scipy.distutils.command.misc_util import appendpath\n+from scipy.distutils.misc_util import appendpath\n from os.path import join\n \n class test_appendpath(ScipyTestCase):\n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "import sys\nfrom scipy.test.testing import *\nfrom scipy.distutils.misc_util import appendpath\nfrom os.path import join\n\nclass test_appendpath(ScipyTestCase):\n\n    def check_1(self):\n        assert_equal(appendpath('prefix','name'),join('prefix','name'))\n        assert_equal(appendpath('/prefix','name'),join('/prefix','name'))\n        assert_equal(appendpath('/prefix','/name'),join('/prefix','name'))\n        assert_equal(appendpath('prefix','/name'),join('prefix','name'))\n\n    def check_2(self):\n        assert_equal(appendpath('prefix/sub','name'),\n                     join('prefix','sub','name'))\n        assert_equal(appendpath('prefix/sub','sup/name'),\n                     join('prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub','/prefix/name'),\n                     join('/prefix','sub','name'))\n\n    def check_3(self):\n        assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),\n                     join('/prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),\n                     join('/prefix','sub','sub2','sup','sup2','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),\n                     join('/prefix','sub','sub2','sup','name'))\n\nif __name__ == \"__main__\":\n    ScipyTest().run()\n",
                "source_code_before": "import sys\nfrom scipy.test.testing import *\nfrom scipy.distutils.command.misc_util import appendpath\nfrom os.path import join\n\nclass test_appendpath(ScipyTestCase):\n\n    def check_1(self):\n        assert_equal(appendpath('prefix','name'),join('prefix','name'))\n        assert_equal(appendpath('/prefix','name'),join('/prefix','name'))\n        assert_equal(appendpath('/prefix','/name'),join('/prefix','name'))\n        assert_equal(appendpath('prefix','/name'),join('prefix','name'))\n\n    def check_2(self):\n        assert_equal(appendpath('prefix/sub','name'),\n                     join('prefix','sub','name'))\n        assert_equal(appendpath('prefix/sub','sup/name'),\n                     join('prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub','/prefix/name'),\n                     join('/prefix','sub','name'))\n\n    def check_3(self):\n        assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),\n                     join('/prefix','sub','sup','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),\n                     join('/prefix','sub','sub2','sup','sup2','name'))\n        assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),\n                     join('/prefix','sub','sub2','sup','name'))\n\nif __name__ == \"__main__\":\n    ScipyTest().run()\n",
                "methods": [
                    {
                        "name": "check_1",
                        "long_name": "check_1( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 69,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 8,
                        "end_line": 12,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_2",
                        "long_name": "check_2( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 61,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 14,
                        "end_line": 20,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_3",
                        "long_name": "check_3( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 71,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 22,
                        "end_line": 28,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    }
                ],
                "methods_before": [
                    {
                        "name": "check_1",
                        "long_name": "check_1( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 69,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 8,
                        "end_line": 12,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_2",
                        "long_name": "check_2( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 61,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 14,
                        "end_line": 20,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "check_3",
                        "long_name": "check_3( self )",
                        "filename": "test_misc_util.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 71,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 22,
                        "end_line": 28,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    }
                ],
                "changed_methods": [],
                "nloc": 26,
                "complexity": 3,
                "token_count": 246,
                "diff_parsed": {
                    "added": [
                        "from scipy.distutils.misc_util import appendpath"
                    ],
                    "deleted": [
                        "from scipy.distutils.command.misc_util import appendpath"
                    ]
                }
            }
        ]
    },
    {
        "hash": "2c6e233984b6af96d3bf3a38b4932aa5f4c433ad",
        "msg": "Fixed so that array always returns an array object.",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-13T23:39:44+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T23:39:44+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "4d9e46d48de3ce4039ce5ebe5433eab339067b98"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 65,
        "insertions": 125,
        "lines": 190,
        "files": 6,
        "dmm_unit_size": 0.06896551724137931,
        "dmm_unit_complexity": 0.06896551724137931,
        "dmm_unit_interfacing": 0.0,
        "modified_files": [
            {
                "old_path": "scipy/base/include/scipy/arrayobject.h",
                "new_path": "scipy/base/include/scipy/arrayobject.h",
                "filename": "arrayobject.h",
                "extension": "h",
                "change_type": "MODIFY",
                "diff": "@@ -811,28 +811,23 @@ typedef struct {\n \t\t\t\t it is also FORTRAN contiguous \n \t\t\t      */\n \n-\t/* Not used -- always assumed \n-#define OWN_DIMENSIONS 2  \n-#define OWN_STRIDES    4  \n-\t*/\n+#define FORTRAN    2    /* set if array is a contiguous Fortran array */\n+                       /*  first index varies the fastest in memory\n+                           (strides array is reverse of C-contiguous\n+\t\t\t           array)*/\n \n-#define OWNDATA        8\n+#define OWNDATA        4\n #define OWN_DATA       OWNDATA\n \n-#define FORTRAN    0x020    /* set if array is a contiguous Fortran array */\n-\t                    /*  first index varies the fastest in memory\n-\t\t\t        (strides array is reverse of C-contiguous\n-\t\t\t           array)*/\n-\n-\t/* array never has these two set -- FromAny flags only */\n-#define FORCECAST     0x040    \n-#define ENSURECOPY    0x080 \t\n+\t/* array never has these three set -- FromAny flags only */\n+#define FORCECAST     0x010    \n+#define ENSURECOPY    0x020\n+#define ENSUREARRAY   0x040\n \n #define ALIGNED       0x100\n #define NOTSWAPPED    0x200\n #define WRITEABLE     0x400\n \n-  /* Flag used in creating a new array, not set in the array */\n \n \t/* If this flags is set, then base contains a pointer to \n \t   an array of the same size that should be updated with the \n",
                "added_lines": 9,
                "deleted_lines": 14,
                "source_code": "\n/* This expects the following variables to be defined (besides\n   the usual ones from pyconfig.h\n\n   SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no\n                         long double is present on platform.\n   CHAR_BIT       --     number of bits in a char (usually 8)\n                         (should be in limits.h)\n*/\n\n#ifndef Py_ARRAYOBJECT_H\n#define Py_ARRAYOBJECT_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"config.h\"\n\n/* There are several places in the code where an array of dimensions is */\n/* allocated statically.  This is the size of that static allocation. */\n\n#define MAX_DIMS 40\n\n/* Used for Converter Functions \"O&\" code in ParseTuple */\n#define PY_FAIL 0\n#define PY_SUCCEED 1\n\n#define NDARRAY_VERSION 0x0400\n\n\t/* Some platforms don't define bool, long long, or long double.\n\t   Handle that here.\n\t */\n\n#ifdef PY_LONG_LONG\ntypedef PY_LONG_LONG longlong;\ntypedef unsigned PY_LONG_LONG ulonglong;\n#  ifdef _MSC_VER\n#    define LONGLONG_FMT         \"%I64d\"\n#    define ULONGLONG_FMT        \"%I64u\"\n#    define LONGLONG_SUFFIX(x)   (x##i64)\n#    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n#  else\n\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant\n           #define ULONGLONG_FMT  \"%llu\"\n\n\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?\n\t   #define ULONGLONG_FMT   \"%qu\"\n\t*/\n#    define LONGLONG_FMT         \"%Ld\"\n#    define ULONGLONG_FMT        \"%Lu\"\n#    define LONGLONG_SUFFIX(x)   (x##LL)\n#    define ULONGLONG_SUFFIX(x)  (x##ULL)\n#  endif\n#else\ntypedef long longlong;\ntypedef unsigned long ulonglong;\n#  define LONGLONG_SUFFIX(x)  (x##L)\n#  define ULONGLONG_SUFFIX(x) (x##UL)\n#endif\n\ntypedef unsigned char Bool;\n#ifndef FALSE\n#define FALSE 0\n#endif\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE\n\ttypedef double longdouble;\n        #define LONGDOUBLE_FMT \"g\"\n#else\n\ttypedef long double longdouble;\n        #define LONGDOUBLE_FMT \"Lg\"\n#endif\n\n#ifndef Py_USING_UNICODE\n#define Py_UNICODE char\n#endif\n\n\ntypedef signed char byte;\ntypedef unsigned char ubyte;\ntypedef unsigned short ushort;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\n\ntypedef struct { float real, imag; } cfloat;\ntypedef struct { double real, imag; } cdouble;\ntypedef struct {longdouble real, imag;} clongdouble;\n\nenum PyArray_TYPES {    PyArray_BOOL=0,\n                        PyArray_BYTE, PyArray_UBYTE,\n\t\t        PyArray_SHORT, PyArray_USHORT,\n\t\t        PyArray_INT, PyArray_UINT,\n\t\t\tPyArray_LONG, PyArray_ULONG,\n                        PyArray_LONGLONG, PyArray_ULONGLONG,\n\t\t\tPyArray_FLOAT, PyArray_DOUBLE, PyArray_LONGDOUBLE,\n\t\t\tPyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CLONGDOUBLE,\n\t\t\tPyArray_OBJECT=17,\n                        PyArray_STRING, PyArray_UNICODE,\n\t\t\tPyArray_VOID,\n\t\t\tPyArray_NTYPES,\n\t\t\tPyArray_NOTYPE,\n\t\t\tPyArray_USERDEF=256  /* leave room for characters */\n};\n\n\t/* basetype array priority */\n#define PyArray_PRIORITY 0.0\n#define PyArray_BIG_PRIORITY 0.1\n\t/* default subtype priority */\n#define PyArray_SUBTYPE_PRIORITY 1.0\n\n\t/* How many floating point types are there */\n#define PyArray_NUM_FLOATTYPE 3\n\n\n\t/* We need to match intp to a signed integer of the same size as\n\t   a pointer variable. uintp to the equivalent unsigned integer\n\t*/\n\n\n\t/* These characters correspond to the array type and the\n\t   struct module */\n\n\t/*  except 'p' -- signed integer for pointer type */\n\nenum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n\t\t\tPyArray_BYTELTR = 'b',\n\t\t\tPyArray_UBYTELTR = 'B',\n\t\t\tPyArray_SHORTLTR = 'h',\n\t\t\tPyArray_USHORTLTR = 'H',\n\t\t\tPyArray_INTLTR = 'i',\n\t\t\tPyArray_UINTLTR = 'I',\n\t\t\tPyArray_LONGLTR = 'l',\n\t\t\tPyArray_ULONGLTR = 'L',  \n\t\t\tPyArray_LONGLONGLTR = 'q',   \n\t\t\tPyArray_ULONGLONGLTR = 'Q',\n\t\t\tPyArray_FLOATLTR = 'f',\n\t\t\tPyArray_DOUBLELTR = 'd',\n\t\t\tPyArray_LONGDOUBLELTR = 'g',\n\t\t\tPyArray_CFLOATLTR = 'F',\n\t\t\tPyArray_CDOUBLELTR = 'D',\n\t\t\tPyArray_CLONGDOUBLELTR = 'G',\n\t\t\tPyArray_OBJECTLTR = 'O',\n\t\t\tPyArray_STRINGLTR = 'S',\n\t\t\tPyArray_UNICODELTR = 'U',\n\t\t        PyArray_VOIDLTR = 'V',\n\n\t\t\t/* No Descriptor, just a define -- this let's\n\t\t\t Python users specify an array of integers\n\t\t\t large enough to hold a pointer on the platform*/\n\t\t\tPyArray_INTPLTR = 'p',\n\t\t\tPyArray_UINTPLTR = 'P',\n\n\t\t\tPyArray_GENBOOLLTR ='b',\n\t\t\tPyArray_SIGNEDLTR = 'i',\n\t\t\tPyArray_UNSIGNEDLTR = 'u',\n\t\t\tPyArray_FLOATINGLTR = 'f',\n\t\t\tPyArray_COMPLEXLTR = 'c'\n};\n\n\t/* Define bit-width array types and typedefs */\n\n#define MAKEFLOAT(x) x.\n\n#define MAX_INT8 127\n#define MIN_INT8 -128\n#define MAX_UINT8 255\n#define MAX_INT16 32767\n#define MIN_INT16 -32768\n#define MAX_UINT16 65535\n#define MAX_INT32 2147483647\n#define MIN_INT32 (-MAX_INT32 - 1)\n#define MAX_UINT32 4294967295U\n#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)\n#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))\n#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)\n#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)\n#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))\n#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)\n#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)\n#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))\n#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\n\t/* Need to find the number of bits for each type and \n\t   make definitions accordingly. \n\n\t   C states that sizeof(char) == 1 by definition \n\t   \n\t   So, just using the sizeof keyword won't help.  \n\n\t   It also looks like Python itself uses sizeof(char) quite a\n\t   bit, which by definition should be 1 all the time.\n\n\t   Idea: Make Use of CHAR_BIT which should tell us how many\n\t   BITS per CHARACTER\n\t*/\n\n\t/* Include platform definitions -- These are in the C89/90 standard */\n#include <limits.h>  \n#define MAX_BYTE SCHAR_MAX\n#define MIN_BYTE SCHAR_MIN\n#define MAX_UBYTE UCHAR_MAX\n#define MAX_SHORT SHRT_MAX\n#define MIN_SHORT SHRT_MIN\n#define MAX_USHORT USHRT_MAX\n#define MAX_INT   INT_MAX\n#ifndef INT_MIN\n#define INT_MIN (-INT_MAX - 1)\n#endif\n#define MIN_INT   INT_MIN\n#define MAX_UINT  UINT_MAX\n#define MAX_LONG  LONG_MAX\n#define MIN_LONG  LONG_MIN\n#define MAX_ULONG  ULONG_MAX\n\n#define SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE\n#define SIZEOF_LONGLONG SIZEOF_LONG_LONG\n#define BITSOF_BOOL sizeof(Bool)*CHAR_BIT\n#define BITSOF_CHAR CHAR_BIT\n#define BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)\n#define BITSOF_INT (SIZEOF_INT*CHAR_BIT)\n#define BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)\n#define BITSOF_LONGLONG (SIZEOF_LONGLONG*CHAR_BIT)\n#define BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)\n#define BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)\n#define BITSOF_LONGDOUBLE (SIZEOF_LONGDOUBLE*CHAR_BIT)\n\n\n#if BITSOF_LONG == 8\n#define PyArray_INT8 PyArray_LONG\n#define PyArray_UINT8 PyArray_ULONG\n\ttypedef long Int8;\n\ttypedef unsigned long UInt8;\n#define STRBITSOF_LONG \"8\"\n#elif BITSOF_LONG == 16\n#define PyArray_INT16 PyArray_LONG\n#define PyArray_UINT16 PyArray_ULONG\n\ttypedef long Int16;\n\ttypedef unsigned long UInt16;\n#define STRBITSOF_LONG \"16\"\n#elif BITSOF_LONG == 32\n#define PyArray_INT32 PyArray_LONG\n#define PyArray_UINT32 PyArray_ULONG\n\ttypedef long Int32;\n\ttypedef unsigned long UInt32;\n#define STRBITSOF_LONG \"32\"\n#elif BITSOF_LONG == 64\n#define PyArray_INT64 PyArray_LONG\n#define PyArray_UINT64 PyArray_ULONG\n\ttypedef long Int64;\n\ttypedef unsigned long UInt64;\n#define STRBITSOF_LONG \"64\"\n#elif BITSOF_LONG == 128\n#define PyArray_INT128 PyArray_LONG\n#define PyArray_UINT128 PyArray_ULONG\n\ttypedef long Int128;\n\ttypedef unsigned long UInt128;\n#define STRBITSOF_LONG \"128\"\n#endif\n\n#if BITSOF_LONGLONG == 8\n#  ifndef PyArray_INT8\n#    define PyArray_INT8 PyArray_LONGLONG\n#    define PyArray_UINT8 PyArray_ULONGLONG\n\ttypedef longlong Int8;\n\ttypedef ulonglong UInt8;\n#  endif\n#  define MAX_LONGLONG MAX_INT8\n#  define MIN_LONGLONG MIN_INT8\n#  define MAX_ULONGLONG MAX_UINT8\n#define STRBITSOF_LONGLONG \"8\"\n#elif BITSOF_LONGLONG == 16\n#  ifndef PyArray_INT16\n#    define PyArray_INT16 PyArray_LONGLONG\n#    define PyArray_UINT16 PyArray_ULONGLONG\n\ttypedef longlong Int16;\n\ttypedef ulonglong UInt16;\n#  endif\n#  define MAX_LONGLONG MAX_INT16\n#  define MIN_LONGLONG MIN_INT16\n#  define MAX_ULONGLONG MAX_UINT16\n#define STRBITSOF_LONGLONG \"16\"\n#elif BITSOF_LONGLONG == 32\n#  ifndef PyArray_INT32\n#    define PyArray_INT32 PyArray_LONGLONG\n#    define PyArray_UINT32 PyArray_ULONGLONG\n\ttypedef longlong Int32;\n\ttypedef ulonglong UInt32;\n#  endif\n#  define MAX_LONGLONG MAX_INT32\n#  define MIN_LONGLONG MIN_INT32\n#  define MAX_ULONGLONG MAX_UINT32\n#define STRBITSOF_LONGLONG \"32\"\n#elif BITSOF_LONGLONG == 64\n#  ifndef PyArray_INT64\n#    define PyArray_INT64 PyArray_LONGLONG\n#    define PyArray_UINT64 PyArray_ULONGLONG\n\ttypedef longlong Int64;\n\ttypedef ulonglong UInt64;\n#  endif\n#  define MAX_LONGLONG MAX_INT64\n#  define MIN_LONGLONG MIN_INT64\n#  define MAX_ULONGLONG MAX_UINT64\n#define STRBITSOF_LONGLONG \"64\"\n#elif BITSOF_LONGLONG == 128\n#  ifndef PyArray_INT128\n#    define PyArray_INT128 PyArray_LONGLONG\n#    define PyArray_UINT128 PyArray_ULONGLONG\n\ttypedef longlong Int128;\n\ttypedef ulonglong UInt128;\n#  endif\n#  define MAX_LONGLONG MAX_INT128\n#  define MIN_LONGLONG MIN_INT128\n#  define MAX_ULONGLONG MAX_UINT128\n#define STRBITSOF_LONGLONG \"128\"\n#elif BITSOF_LONGLONG == 256\n#  define PyArray_INT256 PyArray_LONGLONG\n#  define PyArray_UINT256 PyArray_ULONGLONG\n\ttypedef longlong Int256;\n\ttypedef ulonglong UInt256;\n#  define MAX_LONGLONG MAX_INT256\n#  define MIN_LONGLONG MIN_INT256\n#  define MAX_ULONGLONG MAX_UINT256\n#define STRBITSOF_LONGLONG \"256\"\n#endif\n\n#if BITSOF_INT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_INT\n#define PyArray_UINT8 PyArray_UINT\n\ttypedef int Int8;\n\ttypedef unsigned int UInt8;\n#endif\n#define STRBITSOF_INT \"8\"\n#elif BITSOF_INT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_INT\n#define PyArray_UINT16 PyArray_UINT\n\ttypedef int Int16;\n\ttypedef unsigned int UInt16;\n#endif\n#define STRBITSOF_INT \"16\"\n#elif BITSOF_INT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_INT\n#define PyArray_UINT32 PyArray_UINT\n\ttypedef int Int32;\n\ttypedef unsigned int UInt32;\n#endif\n#define STRBITSOF_INT \"32\"\n#elif BITSOF_INT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_INT\n#define PyArray_UINT64 PyArray_UINT\n\ttypedef int Int64;\n\ttypedef unsigned int UInt64;\n#endif\n#define STRBITSOF_INT \"64\"\n#elif BITSOF_INT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_INT\n#define PyArray_UINT128 PyArray_UINT\n\ttypedef int Int128;\n\ttypedef unsigned int UInt128;\n#endif\n#define STRBITSOF_INT \"128\"\n#endif\n\n#if BITSOF_SHORT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_SHORT\n#define PyArray_UINT8 PyArray_USHORT\n\ttypedef short Int8;\n\ttypedef unsigned short UInt8;\n#endif\n#define STRBITSOF_SHORT \"8\"\n#elif BITSOF_SHORT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_SHORT\n#define PyArray_UINT16 PyArray_USHORT\n\ttypedef short Int16;\n\ttypedef unsigned short UInt16;\n#endif\n#define STRBITSOF_SHORT \"16\"\n#elif BITSOF_SHORT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_SHORT\n#define PyArray_UINT32 PyArray_USHORT\n\ttypedef short Int32;\n\ttypedef unsigned short UInt32;\n#endif\n#define STRBITSOF_SHORT \"32\"\n#elif BITSOF_SHORT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_SHORT\n#define PyArray_UINT64 PyArray_USHORT\n\ttypedef short Int64;\n\ttypedef unsigned short UInt64;\n#endif\n#define STRBITSOF_SHORT \"64\"\n#elif BITSOF_SHORT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_SHORT\n#define PyArray_UINT128 PyArray_USHORT\n\ttypedef short Int128;\n\ttypedef unsigned short UInt128;\n#endif\n#define STRBITSOF_SHORT \"128\"\n#endif\n\n\n#if BITSOF_CHAR == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_BYTE\n#define PyArray_UINT8 PyArray_UBYTE\n\ttypedef signed char Int8;\n\ttypedef unsigned char UInt8;\n#endif\n#define STRBITSOF_CHAR \"8\"\n#elif BITSOF_CHAR == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_BYTE\n#define PyArray_UINT16 PyArray_UBYTE\n\ttypedef signed char Int16;\n\ttypedef unsigned char UInt16;\n#endif\n#define STRBITSOF_CHAR \"16\"\n#elif BITSOF_CHAR == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_BYTE\n#define PyArray_UINT32 PyArray_UBYTE\n\ttypedef signed char Int32;\n\ttypedef unsigned char UInt32;\n#endif\n#define STRBITSOF_CHAR \"32\"\n#elif BITSOF_CHAR == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_BYTE\n#define PyArray_UINT64 PyArray_UBYTE\n\ttypedef signed char Int64;\n\ttypedef unsigned char UInt64;\n#endif\n#define STRBITSOF_CHAR \"64\"\n#elif BITSOF_CHAR == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_BYTE\n#define PyArray_UINT128 PyArray_UBYTE\n\ttypedef signed char Int128;\n\ttypedef unsigned char UInt128;\n#endif\n#define STRBITSOF_CHAR \"128\"\n#endif\n\n\n\n#if BITSOF_DOUBLE == 16\n#define STRBITSOF_DOUBLE \"16\"\n#define STRBITSOF_CDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_DOUBLE\n#define PyArray_COMPLEX32 PyArray_CDOUBLE\n\ttypedef  double Float16;\n\ttypedef cdouble Complex32;\n#endif\n#elif BITSOF_DOUBLE == 32\n#define STRBITSOF_DOUBLE \"32\"\n#define STRBITSOF_CDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_DOUBLE\n#define PyArray_COMPLEX64 PyArray_CDOUBLE\n\ttypedef double Float32;\n\ttypedef cdouble Complex64;\n#endif\n#elif BITSOF_DOUBLE == 64\n#define STRBITSOF_DOUBLE \"64\"\n#define STRBITSOF_CDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_DOUBLE\n#define PyArray_COMPLEX128 PyArray_CDOUBLE\n\ttypedef double Float64;\n\ttypedef cdouble Complex128;\n#endif\n#elif BITSOF_DOUBLE == 80\n#define STRBITSOF_DOUBLE \"80\"\n#define STRBITSOF_CDOUBLE \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_DOUBLE\n#define PyArray_COMPLEX160 PyArray_CDOUBLE\n\ttypedef double Float80\n\ttypedef cdouble Complex160\n#endif\n#elif BITSOF_DOUBLE == 96\n#define STRBITSOF_DOUBLE \"96\"\n#define STRBITSOF_CDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_DOUBLE\n#define PyArray_COMPLEX192 PyArray_CDOUBLE\n\ttypedef double Float96;\n\ttypedef cdouble Complex192;\n#endif\n#elif BITSOF_DOUBLE == 128\n#define STRBITSOF_DOUBLE \"128\"\n#define STRBITSOF_CDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_DOUBLE\n#define PyArray_COMPLEX256 PyArray_CDOUBLE\n\ttypedef double Float128;\n\ttypedef cdouble Complex256;\n#endif\n#endif\n\n\n\n#if BITSOF_FLOAT == 16\n#define STRBITSOF_FLOAT \"16\"\n#define STRBITSOF_CFLOAT \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_FLOAT\n#define PyArray_COMPLEX32 PyArray_CFLOAT\n\ttypedef float Float16;\n\ttypedef cfloat Complex32;\n#endif\n#elif BITSOF_FLOAT == 32\n#define STRBITSOF_FLOAT \"32\"\n#define STRBITSOF_CFLOAT \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_FLOAT\n#define PyArray_COMPLEX64 PyArray_CFLOAT\n\ttypedef float Float32;\n\ttypedef cfloat Complex64;\n#endif\n#elif BITSOF_FLOAT == 64\n#define STRBITSOF_FLOAT \"64\"\n#define STRBITSOF_CFLOAT \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_FLOAT\n#define PyArray_COMPLEX128 PyArray_CFLOAT\n\ttypedef float Float64;\n\ttypedef cfloat Complex128;\n#endif\n#elif BITSOF_FLOAT == 80\n#define STRBITSOF_FLOAT \"80\"\n#define STRBITSOF_CFLOAT \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_FLOAT\n#define PyArray_COMPLEX160 PyArray_CFLOAT\n\ttypedef float Float80\n\ttypedef cfloat Complex160\n#endif\n#elif BITSOF_FLOAT == 96\n#define STRBITSOF_FLOAT \"96\"\n#define STRBITSOF_CFLOAT \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_FLOAT\n#define PyArray_COMPLEX192 PyArray_CFLOAT\n\ttypedef float Float96;\n\ttypedef cfloat Complex192;\n#endif\n#elif BITSOF_FLOAT == 128\n#define STRBITSOF_FLOAT \"128\"\n#define STRBITSOF_CFLOAT \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_FLOAT\n#define PyArray_COMPLEX256 PyArray_CFLOAT\n\ttypedef float Float128;\n\ttypedef cfloat Complex256;\n#endif\n#endif\n\n\n#if BITSOF_LONGDOUBLE == 16\n#define STRBITSOF_LONGDOUBLE \"16\"\n#define STRBITSOF_CLONGDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX32 PyArray_CLONGDOUBLE\n\ttypedef  longdouble Float16;\n\ttypedef clongdouble Complex32;\n#endif\n#elif BITSOF_LONGDOUBLE == 32\n#define STRBITSOF_LONGDOUBLE \"32\"\n#define STRBITSOF_CLONGDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX64 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float32;\n\ttypedef clongdouble Complex64;\n#endif\n#elif BITSOF_LONGDOUBLE == 64\n#define STRBITSOF_LONGDOUBLE \"64\"\n#define STRBITSOF_CLONGDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX128 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float64;\n\ttypedef clongdouble Complex128;\n#endif\n#elif BITSOF_LONGDOUBLE == 80\n#define STRBITSOF_LONGDOUBLE \"80\"\n#define STRBITSOF_CLONGDOUBLE \"160\" \n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX160 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float80\n\ttypedef clongdouble Complex160\n#endif\n#elif BITSOF_LONGDOUBLE == 96\n#define STRBITSOF_LONGDOUBLE \"96\"\n#define STRBITSOF_CLONGDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX192 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float96;\n\ttypedef clongdouble Complex192;\n#endif\n#elif BITSOF_LONGDOUBLE == 128\n#define STRBITSOF_LONGDOUBLE \"128\"\n#define STRBITSOF_CLONGDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX256 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float128;\n\ttypedef clongdouble Complex256;\n#endif\n#elif BITSOF_LONGDOUBLE == 256\n#define STRBITSOF_LONGDOUBLE \"256\"\n#define STRBITSOF_CLONGDOUBLE \"512\"\n#define PyArray_FLOAT256 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX512 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float256;\n\ttypedef clongdouble Complex512;\n#endif\n\n\n\t/* End of typedefs for numarray style bit-width names */\n\n/* This is to typedef Intp to the appropriate pointer size for this platform.\n * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */\ntypedef Py_intptr_t intp;\ntypedef Py_uintptr_t uintp;\n\n#define INTP_STRFORMAT \"%d\"\n\n#if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n\t#define PyArray_INTP PyArray_INT\n\t#define PyArray_UINTP PyArray_UINT\n        #define PyIntpArrType_Type PyIntArrType_Type\n        #define PyUIntpArrType_Type PyUIntArrType_Type\n\t#define MAX_INTP MAX_INT\n\t#define MIN_INTP MIN_INT\n\t#define MAX_UINTP MAX_UINT\n#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG\n\t#define PyArray_INTP PyArray_LONG\n\t#define PyArray_UINTP PyArray_ULONG\n        #define PyIntpArrType_Type PyLongArrType_Type\n        #define PyUIntpArrType_Type PyULongArrType_Type\n\t#define MAX_INTP MAX_LONG\n\t#define MIN_INTP MIN_LONG\n\t#define MAX_UINTP MAX_ULONG\n#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)\n\t#define PyArray_INTP PyArray_LONGLONG\n\t#define PyArray_UINTP PyArray_ULONGLONG\n        #define PyIntpArrType_Type PyLongLongArrType_Type\n        #define PyUIntpArrType_Type PyULongLongArrType_Type\n\t#define MAX_INTP MAX_LONGLONG\n\t#define MIN_INTP MIN_LONGLONG\n\t#define MAX_UINTP MAX_ULONGLONG\n        #undef INTP_STRFORMAT\n        #define INTP_STRFORMAT \"%Ld\"\n#endif\n\n#define ERR(str) fprintf(stderr, #str); fflush(stderr);\n#define ERR2(str) fprintf(stderr, str); fflush(stderr);\n\n  /* Macros to define how array, and dimension/strides data is\n     allocated. \n  */\n\n  /* Data buffer */\n#define PyDataMem_NEW(size) ((char *)malloc(size))\n  /* #define PyArrayMem_NEW(size) PyMem_NEW(char, size)*/\n#define PyDataMem_FREE(ptr)  free(ptr)\n  /* #define PyArrayMem_FREE(ptr) PyMem_Free(ptr) */\n#define PyDataMem_RENEW(ptr,size) ((char *)realloc(ptr,size))\n\n  /* Dimensions and strides */\n#define PyDimMem_NEW(size) ((intp *)malloc(size*sizeof(intp)))\n#define PyDimMem_FREE(ptr) free(ptr)\n#define PyDimMem_RENEW(ptr,size) ((intp *)realloc(ptr,size*sizeof(intp)))\n\n\n  /* These must deal with unaligned and unbyteswapped data if necessary */\ntypedef PyObject * (PyArray_GetItemFunc) (char *, void *);\ntypedef int (PyArray_SetItemFunc)(PyObject *, char *, void *);\n\ntypedef int (PyArray_CompareFunc)(const void *, const void *, void *);\ntypedef void (PyArray_CopySwapNFunc)(void *, void *, intp, int, int);\ntypedef void (PyArray_CopySwapFunc)(void *, void *, int, int);\ntypedef Bool (PyArray_NonzeroFunc)(void *, void *);\n\n\n  /* These assume aligned and byteswapped data -- a buffer will be\n      used before or contiguous data will be obtained\n  */\ntypedef int (PyArray_ArgFunc)(void*, intp, intp*, void *);\ntypedef void (PyArray_DotFunc)(char *, intp, char *, intp, char *, intp, \n\t\t\t       void *);\ntypedef void (PyArray_VectorUnaryFunc)(void *, void *, intp, void *, void *);\ntypedef int (PyArray_ScanFunc)(FILE *, void *, int, char *, void *);\n\n\ntypedef struct {\n \tPyTypeObject *typeobj;  /* the type object for this type */\n\tchar kind;              /* kind for this type */\n\tchar type;              /* character representing this type */\n\tint type_num;           /* number representing this type */\n\tint elsize;             /* element size for this type -- \n\t\t\t\t   or 0 if variable */\n       \tint alignment;          /* alignment needed for this type */\n\n\t/* Functions to cast to all other standard types*/\n\tPyArray_VectorUnaryFunc *cast[PyArray_NTYPES];\n\n\t/* Functions to get and set items with standard\n\t   Python types -- not array scalars */\n\tPyArray_GetItemFunc *getitem;\n\tPyArray_SetItemFunc *setitem;\n\n\t/* Function to compare items */\n\tPyArray_CompareFunc *compare;\n\n  \t/* Function to select largest */\n\tPyArray_ArgFunc *argmax;\n\n\t/* Function to compute dot product */\n\tPyArray_DotFunc\t*dotfunc;\t   \n\t\n\t/* Function to scan an ASCII file and \n\t   place a single value plus possible separator */\n\tPyArray_ScanFunc *scanfunc;\n\n\t/* Copy and/or swap data.  Memory areas may not overlap */\n\t/*  Use memmove first if they might */\n\tPyArray_CopySwapNFunc *copyswapn;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\t/* Function to determine if data is zero or not */\n\tPyArray_NonzeroFunc *nonzero;\n\n} PyArray_Descr;\n\n\ntypedef struct PyArrayObject {\n\tPyObject_HEAD\n\tchar *data;             /* pointer to raw data buffer */\n\tint nd;                 /* number of dimensions, also called ndim */ \n\tintp *dimensions;       /* size in each dimension */\n        intp *strides;          /* bytes to jump to get to the \n\t\t\t\t   next element in each dimension */\n\tPyObject *base;         /* This object should be decref'd\n\t\t\t\t   upon deletion of array */\n\t                        /* For views it points to the original array */\n\t                        /* For creation from buffer object it points \n\t\t\t\t   to an object that shold be decref'd on \n\t\t\t\t   deletion */\n\t                        /* For UPDATEIFCOPY flag this is an array \n\t\t\t\t   to-be-updated upon deletion of this one */\n\tPyArray_Descr *descr;   /* Pointer to type structure */\n\tint flags;              /* Flags describing array -- see below*/\n\tint itemsize;           /* needed for Flexible size arrays:\n                                   CHAR, UNICODE, and VOID arrays\n \t\t\t         */ \n\tPyObject *weakreflist;  /* For weakreferences */\n\n} PyArrayObject;\n\n#define fortran fortran_  /* For some compilers */\n\ntypedef struct {   /* Just the type_num and itemsize variables \n\t\t      for use in the TypeNum Converter function */\n\tint type_num;\n\tint itemsize;\n\tint fortran;  /* Set to 1 if fortran-defined strides is desired */\n} PyArray_Typecode;\n\ntypedef struct {\n        intp *ptr;\n        int len;\n} PyArray_Dims;\n\n\n/* Mirrors buffer object to ptr */\n\ntypedef struct {\n        PyObject_HEAD\n        PyObject *base;\n        void *ptr;\n        intp len;\n        int flags;        \n} PyArray_Chunk;\n\n/* Array flags */\n#define CONTIGUOUS     1      /* means c-style contiguous (last index\n\t\t\t       varies the fastest) data elements right\n\t\t\t      after each other. */\n\n\t                      /* All 0-d arrays are CONTIGUOUS and FORTRAN\n\t\t\t\t contiguous.  If a 1-d array is CONTIGUOUS\n\t\t\t\t it is also FORTRAN contiguous \n\t\t\t      */\n\n#define FORTRAN    2    /* set if array is a contiguous Fortran array */\n                       /*  first index varies the fastest in memory\n                           (strides array is reverse of C-contiguous\n\t\t\t           array)*/\n\n#define OWNDATA        4\n#define OWN_DATA       OWNDATA\n\n\t/* array never has these three set -- FromAny flags only */\n#define FORCECAST     0x010    \n#define ENSURECOPY    0x020\n#define ENSUREARRAY   0x040\n\n#define ALIGNED       0x100\n#define NOTSWAPPED    0x200\n#define WRITEABLE     0x400\n\n\n\t/* If this flags is set, then base contains a pointer to \n\t   an array of the same size that should be updated with the \n\t   current contents of this array when this array is deallocated\n\t*/\n#define UPDATEIFCOPY  0x1000\n\n\n/* Size of internal buffers used for alignment */\n#define PyArray_BUFSIZE 10000\n#define PyArray_MIN_BUFSIZE 5\n#define PyArray_MAX_BUFSIZE MAX_INT32\n#define MAXBUFNUM 1024\n\n\n#define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n#define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n#define CARRAY_FLAGS CONTIGUOUS | BEHAVED_FLAGS\n#define FARRAY_FLAGS FORTRAN | BEHAVED_FLAGS\n#define DEFAULT_FLAGS CARRAY_FLAGS\n\n#define UPDATE_ALL_FLAGS CONTIGUOUS | FORTRAN | ALIGNED\n\n\n/*\n * C API:  consists of Macros and functions.  The MACROS are defined here. \n */\n\n\n#define PyArray_CHKFLAGS(m, FLAGS) \\\n\t((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))\n#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, CONTIGUOUS)\n#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, WRITEABLE)\n\n#define PyArray_ISCARRAY(m) PyArray_CHKFLAGS(m, CARRAY_FLAGS)\n#define PyArray_ISFARRAY(m) PyArray_CHKFLAGS(m, FARRAY_FLAGS)\n#define PyArray_ISBEHAVED(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS)\n#define PyArray_ISBEHAVED_RO(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS_RO)\n\n\n#ifndef MAX\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#endif\n#ifndef MIN\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#endif\n\n        /* Useful if a and b have to be evaluated.  */\n\n#define tMAX(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_>_y_ ? _x_ : _y_}\n#define tMIN(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_<_y_ ? _x_ : _y_}\n\n#if defined(ALLOW_THREADS)\n#define BEGIN_THREADS_DEF PyThreadState *_save;\n#define BEGIN_THREADS _save = PyEval_SaveThread();\n#define END_THREADS   PyEval_RestoreThread(_save);\n#define ALLOW_C_API_DEF  PyGILState_STATE __save__;\n#define ALLOW_C_API      __save__ = PyGILState_Ensure();\n#define DISABLE_C_API    PyGILState_Release(__save__);\n#else\n#define BEGIN_THREADS_DEF\n#define BEGIN_THREADS\n#define END_THREADS\n#define ALLOW_C_API_DEF\n#define\tALLOW_C_API    \n#define\tDISABLE_C_API  \n#endif\n\ntypedef struct {\n        PyObject_HEAD\n\tint                     nd_m1;            /* number of dimensions - 1 */\n        intp\t\t        index, size;\n\tintp                    coordinates[MAX_DIMS];/* N-dimensional loop */\n        intp                    dims_m1[MAX_DIMS];    /* ao->dimensions - 1 */\n\tintp                    strides[MAX_DIMS];    /* ao->strides or fake */\n\tintp                    backstrides[MAX_DIMS];/* how far to jump back */\n\tintp                    factors[MAX_DIMS];     /* shape factors */\n\tPyArrayObject           *ao;\n\tchar                    *dataptr;        /* pointer to current item*/\n        unsigned char           contiguous;\n} PyArrayIterObject;\n\n\n/* Iterator API */ \n#define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type)\n\t\n#define PyArray_ITER_RESET(it) {\t\t\t\t\t\\\n\tit->index = 0;\t\t\t\t\t\t        \\\n\tit->dataptr = it->ao->data;\t\t\t\t\t\\\n\tmemset(it->coordinates, 0, (it->nd_m1+1)*sizeof(intp));\t\t\\\n}\n\n\n#define PyArray_ITER_NEXT(it) {\t\t\t\t\\\n\tit->index++;\t\t\t\t\t\\\n\tif (it->contiguous)  it->dataptr += it->ao->itemsize;\t       \\\n\telse {\t\t\t\t\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_ >= 0; _i_--) {\t\t\\\n\t\t\tif (it->coordinates[_i_] <\t\t\t\\\n\t\t\t    it->dims_m1[_i_]) {\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_]++;\t\t\t\\\n\t\t\t\tit->dataptr += it->strides[_i_];\t\\\n\t\t\t\tbreak;\t\t\t\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t\telse {\t\t\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_] = 0;\t\t\\\n\t\t\t\tit->dataptr -= it->backstrides[_i_];\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n}\n\n#define PyArray_ITER_GOTO(it, destination) {\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tit->index = 0;\t\t\t\t\t\t\\\n\t\tit->dataptr = it->ao->data;\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_>=0; _i_--) {\t\t\t\\\n\t\t\tit->dataptr += destination[_i_] *\t\t\\\n\t\t\t\tit->strides[_i_];\t\t\t\\\n\t\t\tit->coordinates[_i_] = destination[_i_];\t\\\n\t\t\tit->index += destination[_i_] *\t\t\t\\\n\t\t\t\t( _i_==it->nd_m1 ? 1 :\t\t\t\\\n\t\t\t\t  it->dims_m1[i+1]+1) ;\t  \t        \\\n\t\t}\t\t\t\t\t\t\t\\\n\t} \n\n#define PyArray_ITER_GOTO1D(it, ind) {                                  \\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tintp _lind_ = (intp) (ind);\t\t\t\t\\\n\t\tit->index = _lind_;\t\t\t\t\t\\\n\t\tif (it->contiguous)\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data + (ind) *\t\t\\\n\t\t\t\tit->ao->itemsize;\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data;\t\t\t\\\n\t\t\tfor (_i_ = 0; _i_<=it->nd_m1; _i_++) {\t\t\\\n\t\t\t\tit->dataptr += (_lind_ / it->factors[_i_]) \\\n\t\t\t\t\t* it->strides[_i_];\t\t\\\n\t\t\t\t_lind_ %= it->factors[_i_];\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n}\n\n/* Not constructed anywhere.  Just serves as a standard type that\n   PyArray_Broadcast expects.\n\n   Any object passed to PyArray_Broadcast must be binary compatible with \n   this structure.    \n*/\n\n\ntypedef struct {\n\tPyObject_HEAD\n\n\tint                     numiter;               /* number of iters */\n\tintp                    size;                  /* broadcasted size */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* iterators */\n} PyArrayMultiIterObject;  \n\t\n\n/* Store the information needed for fancy-indexing over an array */\n\ntypedef struct {\n\tPyObject_HEAD\n\t/* Multi-iterator portion --- needs to be present in this order to \n\t   work with PyArray_Broadcast */\n\n\tint                     numiter;               /* number of index-array\n\t\t\t\t\t\t\t  iterators */\n\tintp                    size;                  /* size of broadcasted \n\t\t\t\t\t\t\t  result */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* index object \n\t\t\t\t\t\t\t  iterators */\n\tPyArrayIterObject       *ait;                   /* flat Iterator for \n\t\t\t\t\t\t\t  underlying array */\n\n\t/* flat iterator for subspace (when numiter < nd) */\n\tPyArrayIterObject       *subspace;\n\n\t/* if subspace iteration, then this is the array of \n\t   axes in the underlying array represented by the\n\t   index objects */\n\tint                     iteraxes[MAX_DIMS];\n\t/* if subspace iteration, the these are the coordinates\n\t   to the start of the subspace.\n\t*/\n\tintp                    bscoord[MAX_DIMS];\n\n\t\n\tPyObject                *indexobj;             /* reference to \n\t\t\t\t\t\t\t  creating obj */\n\tint                     view;\n\tint                     consec;\n\tchar                    *dataptr;\n\n} PyArrayMapIterObject;\n\n\n/* Map Iterator API */ \n#define PyArrayMapIter_Check(op) PyObject_TypeCheck(op, &PyArrayMapIter_Type)\n\n\n#define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd)\n#define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, CONTIGUOUS) || \\\n\t\t\t\t PyArray_CHKFLAGS(m, FORTRAN))\n#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, FORTRAN) && (PyArray_NDIM(m) > 1))\n#define PyArray_DATA(obj) (((PyArrayObject *)(obj))->data)\n#define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions)\n#define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides)\n#define PyArray_DIM(obj,n) (((PyArrayObject *)(obj))->dimensions[n])\n#define PyArray_STRIDE(obj,n) (((PyArrayObject *)(obj))->strides[n])\n#define PyArray_BASE(obj) (((PyArrayObject *)(obj))->base)\n#define PyArray_DESCR(obj) (((PyArrayObject *)(obj))->descr)\n#define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags)\n#define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->itemsize)\n#define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num)\n#define PyArray_GETITEM(obj,itemptr)\t\t\t\\\n\t((PyArrayObject *)(obj))->descr->getitem((char *)itemptr,\t\\\n\t\t\t\t\t\t (PyArrayObject *)obj);\n#define PyArray_SETITEM(obj,itemptr,v)\t\t\t\t\t\\\n\t(obj)->descr->setitem((PyObject *)v,(char *)(itemptr),\t\t\\\n\t\t\t      (PyArrayObject *)(obj));\n\n\n#define PyTypeNum_ISBOOL(type) (type == PyArray_BOOL)\n#define PyTypeNum_ISUNSIGNED(type) ((type == PyArray_UBYTE) || \\\n\t\t\t\t (type == PyArray_USHORT) || \\\n\t\t\t\t (type == PyArray_UINT) ||\t\\\n\t\t\t\t (type == PyArray_ULONG) || \\\n\t\t\t\t (type == PyArray_ULONGLONG))\n\n#define PyTypeNum_ISSIGNED(type) ((type == PyArray_BYTE) ||\t\\\n\t\t\t       (type == PyArray_SHORT) ||\t\\\n\t\t\t       (type == PyArray_INT) ||\t\\\n\t\t\t       (type == PyArray_LONG) ||\t\\\n\t\t\t       (type == PyArray_LONGLONG))\n\n#define PyTypeNum_ISINTEGER(type) ((type >= PyArray_BYTE) &&\t\\\n\t\t\t\t(type <= PyArray_ULONGLONG))\n       \n#define PyTypeNum_ISFLOAT(type) ((type >= PyArray_FLOAT) &&  \\\n\t\t\t      (type <= PyArray_LONGDOUBLE))\n\n#define PyTypeNum_ISNUMBER(type) (type <= PyArray_CLONGDOUBLE)\n\n#define PyTypeNum_ISSTRING(type) ((type == PyArray_UCHAR) || \\\n\t\t\t       (type == PyArray_UNICODE))\n\n#define PyTypeNum_ISCOMPLEX(type) ((type >= PyArray_CFLOAT) && \\\n\t\t\t\t(type <= PyArray_CLONGDOUBLE))\n\t\n#define PyTypeNum_ISPYTHON(type) ((type == PyArray_LONG) || \\\n\t\t\t\t  (type == PyArray_DOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_CDOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_OBJECT ))\n\n#define PyTypeNum_ISFLEXIBLE(type) ((type==PyArray_STRING) || \\\n\t\t\t\t    (type==PyArray_UNICODE) ||\t\\\n\t\t\t\t    (type==PyArray_VOID))\n\n#define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \\\n\t\t\t\t   (type < PyArray_USERDEF+\\\n\t\t\t\t    PyArray_NUMUSERTYPES))\n\n#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) &&   \\\n\t\t\t\t     (type <= PyArray_VOID)) ||\t   \\\n\t\t\t\t    (type >= PyArray_USERDEF))\n\t\t\t\t    \n#define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT)\n\n#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))\n#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))\n#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))\n#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n#define PyArray_ISPYTHONTYPE(obj) PyTypeNum_ISPYTHONTYPE(PyArray_TYPE(obj))\n#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))\n\n/* Object arrays ignore notswapped flag */\n#define PyArray_ISNOTSWAPPED(m) (PyArray_CHKFLAGS(m, NOTSWAPPED) || \\\n\t\t\t\t PyArray_ISOBJECT(m))\n\n\n  /*  Often, rather than always convert to an array, \n      we may want to delegate behavior for other objects passed in\n  */\n\n\t/* \n\n#define Py_DELEGATE(op, name)                                     \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, NULL);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS(op, name, args)\t\t\t  \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, args);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS_KWDS(op, name, args, kwds)\t          \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_Call(meth, args, kwds);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\t*/\n\n\n        /* Includes the \"function\" C-API -- these are all stored in a \n\t   list of pointers --- one for each file\n\t   The two lists are concatenated into one in multiarray.\n\t   \n\t   They are available as import_array()\n         */\n\n#include \"__multiarray_api.h\"\n\n\n        /* C-API that requries previous API to be defined */\n\n#define PyArray_Check(op) (PyObject_TypeCheck((op), &PyBigArray_Type))\n#define PyBigArray_CheckExact(op) ((op)->ob_type == &PyBigArray_Type)\n#define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type)\n\n#define PyArray_CheckScalar(m) (PyObject_TypeCheck((m),\t\t\t\\\n\t\t\t\t\t\t   &PyGenericArrType_Type) \\\n\t\t\t\t|| ((PyArray_Check((m))) &&\t\t\\\n\t\t\t\t    (((PyArrayObject *)(m))->nd == 0)))\n#define PyArray_IsScalar(obj, cls)\t\t\t\t\\\n\t(PyObject_TypeCheck((obj), &Py##cls##ArrType_Type))\n#define PyArray_IsPythonScalar(obj) \\\n\t(PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \\\n\t PyLong_Check(obj) || PyBool_Check(obj) || PyString_Check(obj) || \\\n\t PyUnicode_Check(obj))\n#define PyArray_IsAnyScalar(obj) \\\n\t(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))\n\n#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \\\n\t  (PyArrayObject *)(PyArray_ContiguousFromObject((PyObject *)(m), \\\n\t\t                      PyArray_TYPE(m), 0, 0))) \n\n#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))\n#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))\n#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0)\n#define PyArray_FROM_OF(m,flags) PyArray_FromAny(m, NULL, 0, 0, flags)\n\n#define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)\n#define MAX_ELSIZE 2*SIZEOF_LONGDOUBLE\n\n#define PyArray_SimpleNew(nd, dims, typenum) \\\n\tPyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)\n\n        /*Compatibility with old Numeric stuff -- don't use in new code */\n\n#define PyArray_UNSIGNED_TYPES\n#define PyArray_SBYTE PyArray_BYTE\n#define PyArray_CHAR PyArray_BYTE\n#define PyArray_CopyArray PyArray_CopyInto\n#define _PyArray_multiply_list PyArray_MultiplyIntList\n#define PyArray_ISSPACESAVER(m) FALSE\n#define PyScalarArray_Check PyArray_CheckScalar\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !Py_ARRAYOBJECT_H */\n",
                "source_code_before": "\n/* This expects the following variables to be defined (besides\n   the usual ones from pyconfig.h\n\n   SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no\n                         long double is present on platform.\n   CHAR_BIT       --     number of bits in a char (usually 8)\n                         (should be in limits.h)\n*/\n\n#ifndef Py_ARRAYOBJECT_H\n#define Py_ARRAYOBJECT_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"config.h\"\n\n/* There are several places in the code where an array of dimensions is */\n/* allocated statically.  This is the size of that static allocation. */\n\n#define MAX_DIMS 40\n\n/* Used for Converter Functions \"O&\" code in ParseTuple */\n#define PY_FAIL 0\n#define PY_SUCCEED 1\n\n#define NDARRAY_VERSION 0x0400\n\n\t/* Some platforms don't define bool, long long, or long double.\n\t   Handle that here.\n\t */\n\n#ifdef PY_LONG_LONG\ntypedef PY_LONG_LONG longlong;\ntypedef unsigned PY_LONG_LONG ulonglong;\n#  ifdef _MSC_VER\n#    define LONGLONG_FMT         \"%I64d\"\n#    define ULONGLONG_FMT        \"%I64u\"\n#    define LONGLONG_SUFFIX(x)   (x##i64)\n#    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n#  else\n\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant\n           #define ULONGLONG_FMT  \"%llu\"\n\n\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?\n\t   #define ULONGLONG_FMT   \"%qu\"\n\t*/\n#    define LONGLONG_FMT         \"%Ld\"\n#    define ULONGLONG_FMT        \"%Lu\"\n#    define LONGLONG_SUFFIX(x)   (x##LL)\n#    define ULONGLONG_SUFFIX(x)  (x##ULL)\n#  endif\n#else\ntypedef long longlong;\ntypedef unsigned long ulonglong;\n#  define LONGLONG_SUFFIX(x)  (x##L)\n#  define ULONGLONG_SUFFIX(x) (x##UL)\n#endif\n\ntypedef unsigned char Bool;\n#ifndef FALSE\n#define FALSE 0\n#endif\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE\n\ttypedef double longdouble;\n        #define LONGDOUBLE_FMT \"g\"\n#else\n\ttypedef long double longdouble;\n        #define LONGDOUBLE_FMT \"Lg\"\n#endif\n\n#ifndef Py_USING_UNICODE\n#define Py_UNICODE char\n#endif\n\n\ntypedef signed char byte;\ntypedef unsigned char ubyte;\ntypedef unsigned short ushort;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\n\ntypedef struct { float real, imag; } cfloat;\ntypedef struct { double real, imag; } cdouble;\ntypedef struct {longdouble real, imag;} clongdouble;\n\nenum PyArray_TYPES {    PyArray_BOOL=0,\n                        PyArray_BYTE, PyArray_UBYTE,\n\t\t        PyArray_SHORT, PyArray_USHORT,\n\t\t        PyArray_INT, PyArray_UINT,\n\t\t\tPyArray_LONG, PyArray_ULONG,\n                        PyArray_LONGLONG, PyArray_ULONGLONG,\n\t\t\tPyArray_FLOAT, PyArray_DOUBLE, PyArray_LONGDOUBLE,\n\t\t\tPyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CLONGDOUBLE,\n\t\t\tPyArray_OBJECT=17,\n                        PyArray_STRING, PyArray_UNICODE,\n\t\t\tPyArray_VOID,\n\t\t\tPyArray_NTYPES,\n\t\t\tPyArray_NOTYPE,\n\t\t\tPyArray_USERDEF=256  /* leave room for characters */\n};\n\n\t/* basetype array priority */\n#define PyArray_PRIORITY 0.0\n#define PyArray_BIG_PRIORITY 0.1\n\t/* default subtype priority */\n#define PyArray_SUBTYPE_PRIORITY 1.0\n\n\t/* How many floating point types are there */\n#define PyArray_NUM_FLOATTYPE 3\n\n\n\t/* We need to match intp to a signed integer of the same size as\n\t   a pointer variable. uintp to the equivalent unsigned integer\n\t*/\n\n\n\t/* These characters correspond to the array type and the\n\t   struct module */\n\n\t/*  except 'p' -- signed integer for pointer type */\n\nenum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n\t\t\tPyArray_BYTELTR = 'b',\n\t\t\tPyArray_UBYTELTR = 'B',\n\t\t\tPyArray_SHORTLTR = 'h',\n\t\t\tPyArray_USHORTLTR = 'H',\n\t\t\tPyArray_INTLTR = 'i',\n\t\t\tPyArray_UINTLTR = 'I',\n\t\t\tPyArray_LONGLTR = 'l',\n\t\t\tPyArray_ULONGLTR = 'L',  \n\t\t\tPyArray_LONGLONGLTR = 'q',   \n\t\t\tPyArray_ULONGLONGLTR = 'Q',\n\t\t\tPyArray_FLOATLTR = 'f',\n\t\t\tPyArray_DOUBLELTR = 'd',\n\t\t\tPyArray_LONGDOUBLELTR = 'g',\n\t\t\tPyArray_CFLOATLTR = 'F',\n\t\t\tPyArray_CDOUBLELTR = 'D',\n\t\t\tPyArray_CLONGDOUBLELTR = 'G',\n\t\t\tPyArray_OBJECTLTR = 'O',\n\t\t\tPyArray_STRINGLTR = 'S',\n\t\t\tPyArray_UNICODELTR = 'U',\n\t\t        PyArray_VOIDLTR = 'V',\n\n\t\t\t/* No Descriptor, just a define -- this let's\n\t\t\t Python users specify an array of integers\n\t\t\t large enough to hold a pointer on the platform*/\n\t\t\tPyArray_INTPLTR = 'p',\n\t\t\tPyArray_UINTPLTR = 'P',\n\n\t\t\tPyArray_GENBOOLLTR ='b',\n\t\t\tPyArray_SIGNEDLTR = 'i',\n\t\t\tPyArray_UNSIGNEDLTR = 'u',\n\t\t\tPyArray_FLOATINGLTR = 'f',\n\t\t\tPyArray_COMPLEXLTR = 'c'\n};\n\n\t/* Define bit-width array types and typedefs */\n\n#define MAKEFLOAT(x) x.\n\n#define MAX_INT8 127\n#define MIN_INT8 -128\n#define MAX_UINT8 255\n#define MAX_INT16 32767\n#define MIN_INT16 -32768\n#define MAX_UINT16 65535\n#define MAX_INT32 2147483647\n#define MIN_INT32 (-MAX_INT32 - 1)\n#define MAX_UINT32 4294967295U\n#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)\n#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))\n#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)\n#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)\n#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))\n#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)\n#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)\n#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))\n#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\n\t/* Need to find the number of bits for each type and \n\t   make definitions accordingly. \n\n\t   C states that sizeof(char) == 1 by definition \n\t   \n\t   So, just using the sizeof keyword won't help.  \n\n\t   It also looks like Python itself uses sizeof(char) quite a\n\t   bit, which by definition should be 1 all the time.\n\n\t   Idea: Make Use of CHAR_BIT which should tell us how many\n\t   BITS per CHARACTER\n\t*/\n\n\t/* Include platform definitions -- These are in the C89/90 standard */\n#include <limits.h>  \n#define MAX_BYTE SCHAR_MAX\n#define MIN_BYTE SCHAR_MIN\n#define MAX_UBYTE UCHAR_MAX\n#define MAX_SHORT SHRT_MAX\n#define MIN_SHORT SHRT_MIN\n#define MAX_USHORT USHRT_MAX\n#define MAX_INT   INT_MAX\n#ifndef INT_MIN\n#define INT_MIN (-INT_MAX - 1)\n#endif\n#define MIN_INT   INT_MIN\n#define MAX_UINT  UINT_MAX\n#define MAX_LONG  LONG_MAX\n#define MIN_LONG  LONG_MIN\n#define MAX_ULONG  ULONG_MAX\n\n#define SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE\n#define SIZEOF_LONGLONG SIZEOF_LONG_LONG\n#define BITSOF_BOOL sizeof(Bool)*CHAR_BIT\n#define BITSOF_CHAR CHAR_BIT\n#define BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)\n#define BITSOF_INT (SIZEOF_INT*CHAR_BIT)\n#define BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)\n#define BITSOF_LONGLONG (SIZEOF_LONGLONG*CHAR_BIT)\n#define BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)\n#define BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)\n#define BITSOF_LONGDOUBLE (SIZEOF_LONGDOUBLE*CHAR_BIT)\n\n\n#if BITSOF_LONG == 8\n#define PyArray_INT8 PyArray_LONG\n#define PyArray_UINT8 PyArray_ULONG\n\ttypedef long Int8;\n\ttypedef unsigned long UInt8;\n#define STRBITSOF_LONG \"8\"\n#elif BITSOF_LONG == 16\n#define PyArray_INT16 PyArray_LONG\n#define PyArray_UINT16 PyArray_ULONG\n\ttypedef long Int16;\n\ttypedef unsigned long UInt16;\n#define STRBITSOF_LONG \"16\"\n#elif BITSOF_LONG == 32\n#define PyArray_INT32 PyArray_LONG\n#define PyArray_UINT32 PyArray_ULONG\n\ttypedef long Int32;\n\ttypedef unsigned long UInt32;\n#define STRBITSOF_LONG \"32\"\n#elif BITSOF_LONG == 64\n#define PyArray_INT64 PyArray_LONG\n#define PyArray_UINT64 PyArray_ULONG\n\ttypedef long Int64;\n\ttypedef unsigned long UInt64;\n#define STRBITSOF_LONG \"64\"\n#elif BITSOF_LONG == 128\n#define PyArray_INT128 PyArray_LONG\n#define PyArray_UINT128 PyArray_ULONG\n\ttypedef long Int128;\n\ttypedef unsigned long UInt128;\n#define STRBITSOF_LONG \"128\"\n#endif\n\n#if BITSOF_LONGLONG == 8\n#  ifndef PyArray_INT8\n#    define PyArray_INT8 PyArray_LONGLONG\n#    define PyArray_UINT8 PyArray_ULONGLONG\n\ttypedef longlong Int8;\n\ttypedef ulonglong UInt8;\n#  endif\n#  define MAX_LONGLONG MAX_INT8\n#  define MIN_LONGLONG MIN_INT8\n#  define MAX_ULONGLONG MAX_UINT8\n#define STRBITSOF_LONGLONG \"8\"\n#elif BITSOF_LONGLONG == 16\n#  ifndef PyArray_INT16\n#    define PyArray_INT16 PyArray_LONGLONG\n#    define PyArray_UINT16 PyArray_ULONGLONG\n\ttypedef longlong Int16;\n\ttypedef ulonglong UInt16;\n#  endif\n#  define MAX_LONGLONG MAX_INT16\n#  define MIN_LONGLONG MIN_INT16\n#  define MAX_ULONGLONG MAX_UINT16\n#define STRBITSOF_LONGLONG \"16\"\n#elif BITSOF_LONGLONG == 32\n#  ifndef PyArray_INT32\n#    define PyArray_INT32 PyArray_LONGLONG\n#    define PyArray_UINT32 PyArray_ULONGLONG\n\ttypedef longlong Int32;\n\ttypedef ulonglong UInt32;\n#  endif\n#  define MAX_LONGLONG MAX_INT32\n#  define MIN_LONGLONG MIN_INT32\n#  define MAX_ULONGLONG MAX_UINT32\n#define STRBITSOF_LONGLONG \"32\"\n#elif BITSOF_LONGLONG == 64\n#  ifndef PyArray_INT64\n#    define PyArray_INT64 PyArray_LONGLONG\n#    define PyArray_UINT64 PyArray_ULONGLONG\n\ttypedef longlong Int64;\n\ttypedef ulonglong UInt64;\n#  endif\n#  define MAX_LONGLONG MAX_INT64\n#  define MIN_LONGLONG MIN_INT64\n#  define MAX_ULONGLONG MAX_UINT64\n#define STRBITSOF_LONGLONG \"64\"\n#elif BITSOF_LONGLONG == 128\n#  ifndef PyArray_INT128\n#    define PyArray_INT128 PyArray_LONGLONG\n#    define PyArray_UINT128 PyArray_ULONGLONG\n\ttypedef longlong Int128;\n\ttypedef ulonglong UInt128;\n#  endif\n#  define MAX_LONGLONG MAX_INT128\n#  define MIN_LONGLONG MIN_INT128\n#  define MAX_ULONGLONG MAX_UINT128\n#define STRBITSOF_LONGLONG \"128\"\n#elif BITSOF_LONGLONG == 256\n#  define PyArray_INT256 PyArray_LONGLONG\n#  define PyArray_UINT256 PyArray_ULONGLONG\n\ttypedef longlong Int256;\n\ttypedef ulonglong UInt256;\n#  define MAX_LONGLONG MAX_INT256\n#  define MIN_LONGLONG MIN_INT256\n#  define MAX_ULONGLONG MAX_UINT256\n#define STRBITSOF_LONGLONG \"256\"\n#endif\n\n#if BITSOF_INT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_INT\n#define PyArray_UINT8 PyArray_UINT\n\ttypedef int Int8;\n\ttypedef unsigned int UInt8;\n#endif\n#define STRBITSOF_INT \"8\"\n#elif BITSOF_INT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_INT\n#define PyArray_UINT16 PyArray_UINT\n\ttypedef int Int16;\n\ttypedef unsigned int UInt16;\n#endif\n#define STRBITSOF_INT \"16\"\n#elif BITSOF_INT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_INT\n#define PyArray_UINT32 PyArray_UINT\n\ttypedef int Int32;\n\ttypedef unsigned int UInt32;\n#endif\n#define STRBITSOF_INT \"32\"\n#elif BITSOF_INT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_INT\n#define PyArray_UINT64 PyArray_UINT\n\ttypedef int Int64;\n\ttypedef unsigned int UInt64;\n#endif\n#define STRBITSOF_INT \"64\"\n#elif BITSOF_INT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_INT\n#define PyArray_UINT128 PyArray_UINT\n\ttypedef int Int128;\n\ttypedef unsigned int UInt128;\n#endif\n#define STRBITSOF_INT \"128\"\n#endif\n\n#if BITSOF_SHORT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_SHORT\n#define PyArray_UINT8 PyArray_USHORT\n\ttypedef short Int8;\n\ttypedef unsigned short UInt8;\n#endif\n#define STRBITSOF_SHORT \"8\"\n#elif BITSOF_SHORT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_SHORT\n#define PyArray_UINT16 PyArray_USHORT\n\ttypedef short Int16;\n\ttypedef unsigned short UInt16;\n#endif\n#define STRBITSOF_SHORT \"16\"\n#elif BITSOF_SHORT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_SHORT\n#define PyArray_UINT32 PyArray_USHORT\n\ttypedef short Int32;\n\ttypedef unsigned short UInt32;\n#endif\n#define STRBITSOF_SHORT \"32\"\n#elif BITSOF_SHORT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_SHORT\n#define PyArray_UINT64 PyArray_USHORT\n\ttypedef short Int64;\n\ttypedef unsigned short UInt64;\n#endif\n#define STRBITSOF_SHORT \"64\"\n#elif BITSOF_SHORT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_SHORT\n#define PyArray_UINT128 PyArray_USHORT\n\ttypedef short Int128;\n\ttypedef unsigned short UInt128;\n#endif\n#define STRBITSOF_SHORT \"128\"\n#endif\n\n\n#if BITSOF_CHAR == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_BYTE\n#define PyArray_UINT8 PyArray_UBYTE\n\ttypedef signed char Int8;\n\ttypedef unsigned char UInt8;\n#endif\n#define STRBITSOF_CHAR \"8\"\n#elif BITSOF_CHAR == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_BYTE\n#define PyArray_UINT16 PyArray_UBYTE\n\ttypedef signed char Int16;\n\ttypedef unsigned char UInt16;\n#endif\n#define STRBITSOF_CHAR \"16\"\n#elif BITSOF_CHAR == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_BYTE\n#define PyArray_UINT32 PyArray_UBYTE\n\ttypedef signed char Int32;\n\ttypedef unsigned char UInt32;\n#endif\n#define STRBITSOF_CHAR \"32\"\n#elif BITSOF_CHAR == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_BYTE\n#define PyArray_UINT64 PyArray_UBYTE\n\ttypedef signed char Int64;\n\ttypedef unsigned char UInt64;\n#endif\n#define STRBITSOF_CHAR \"64\"\n#elif BITSOF_CHAR == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_BYTE\n#define PyArray_UINT128 PyArray_UBYTE\n\ttypedef signed char Int128;\n\ttypedef unsigned char UInt128;\n#endif\n#define STRBITSOF_CHAR \"128\"\n#endif\n\n\n\n#if BITSOF_DOUBLE == 16\n#define STRBITSOF_DOUBLE \"16\"\n#define STRBITSOF_CDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_DOUBLE\n#define PyArray_COMPLEX32 PyArray_CDOUBLE\n\ttypedef  double Float16;\n\ttypedef cdouble Complex32;\n#endif\n#elif BITSOF_DOUBLE == 32\n#define STRBITSOF_DOUBLE \"32\"\n#define STRBITSOF_CDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_DOUBLE\n#define PyArray_COMPLEX64 PyArray_CDOUBLE\n\ttypedef double Float32;\n\ttypedef cdouble Complex64;\n#endif\n#elif BITSOF_DOUBLE == 64\n#define STRBITSOF_DOUBLE \"64\"\n#define STRBITSOF_CDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_DOUBLE\n#define PyArray_COMPLEX128 PyArray_CDOUBLE\n\ttypedef double Float64;\n\ttypedef cdouble Complex128;\n#endif\n#elif BITSOF_DOUBLE == 80\n#define STRBITSOF_DOUBLE \"80\"\n#define STRBITSOF_CDOUBLE \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_DOUBLE\n#define PyArray_COMPLEX160 PyArray_CDOUBLE\n\ttypedef double Float80\n\ttypedef cdouble Complex160\n#endif\n#elif BITSOF_DOUBLE == 96\n#define STRBITSOF_DOUBLE \"96\"\n#define STRBITSOF_CDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_DOUBLE\n#define PyArray_COMPLEX192 PyArray_CDOUBLE\n\ttypedef double Float96;\n\ttypedef cdouble Complex192;\n#endif\n#elif BITSOF_DOUBLE == 128\n#define STRBITSOF_DOUBLE \"128\"\n#define STRBITSOF_CDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_DOUBLE\n#define PyArray_COMPLEX256 PyArray_CDOUBLE\n\ttypedef double Float128;\n\ttypedef cdouble Complex256;\n#endif\n#endif\n\n\n\n#if BITSOF_FLOAT == 16\n#define STRBITSOF_FLOAT \"16\"\n#define STRBITSOF_CFLOAT \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_FLOAT\n#define PyArray_COMPLEX32 PyArray_CFLOAT\n\ttypedef float Float16;\n\ttypedef cfloat Complex32;\n#endif\n#elif BITSOF_FLOAT == 32\n#define STRBITSOF_FLOAT \"32\"\n#define STRBITSOF_CFLOAT \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_FLOAT\n#define PyArray_COMPLEX64 PyArray_CFLOAT\n\ttypedef float Float32;\n\ttypedef cfloat Complex64;\n#endif\n#elif BITSOF_FLOAT == 64\n#define STRBITSOF_FLOAT \"64\"\n#define STRBITSOF_CFLOAT \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_FLOAT\n#define PyArray_COMPLEX128 PyArray_CFLOAT\n\ttypedef float Float64;\n\ttypedef cfloat Complex128;\n#endif\n#elif BITSOF_FLOAT == 80\n#define STRBITSOF_FLOAT \"80\"\n#define STRBITSOF_CFLOAT \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_FLOAT\n#define PyArray_COMPLEX160 PyArray_CFLOAT\n\ttypedef float Float80\n\ttypedef cfloat Complex160\n#endif\n#elif BITSOF_FLOAT == 96\n#define STRBITSOF_FLOAT \"96\"\n#define STRBITSOF_CFLOAT \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_FLOAT\n#define PyArray_COMPLEX192 PyArray_CFLOAT\n\ttypedef float Float96;\n\ttypedef cfloat Complex192;\n#endif\n#elif BITSOF_FLOAT == 128\n#define STRBITSOF_FLOAT \"128\"\n#define STRBITSOF_CFLOAT \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_FLOAT\n#define PyArray_COMPLEX256 PyArray_CFLOAT\n\ttypedef float Float128;\n\ttypedef cfloat Complex256;\n#endif\n#endif\n\n\n#if BITSOF_LONGDOUBLE == 16\n#define STRBITSOF_LONGDOUBLE \"16\"\n#define STRBITSOF_CLONGDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX32 PyArray_CLONGDOUBLE\n\ttypedef  longdouble Float16;\n\ttypedef clongdouble Complex32;\n#endif\n#elif BITSOF_LONGDOUBLE == 32\n#define STRBITSOF_LONGDOUBLE \"32\"\n#define STRBITSOF_CLONGDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX64 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float32;\n\ttypedef clongdouble Complex64;\n#endif\n#elif BITSOF_LONGDOUBLE == 64\n#define STRBITSOF_LONGDOUBLE \"64\"\n#define STRBITSOF_CLONGDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX128 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float64;\n\ttypedef clongdouble Complex128;\n#endif\n#elif BITSOF_LONGDOUBLE == 80\n#define STRBITSOF_LONGDOUBLE \"80\"\n#define STRBITSOF_CLONGDOUBLE \"160\" \n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX160 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float80\n\ttypedef clongdouble Complex160\n#endif\n#elif BITSOF_LONGDOUBLE == 96\n#define STRBITSOF_LONGDOUBLE \"96\"\n#define STRBITSOF_CLONGDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX192 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float96;\n\ttypedef clongdouble Complex192;\n#endif\n#elif BITSOF_LONGDOUBLE == 128\n#define STRBITSOF_LONGDOUBLE \"128\"\n#define STRBITSOF_CLONGDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX256 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float128;\n\ttypedef clongdouble Complex256;\n#endif\n#elif BITSOF_LONGDOUBLE == 256\n#define STRBITSOF_LONGDOUBLE \"256\"\n#define STRBITSOF_CLONGDOUBLE \"512\"\n#define PyArray_FLOAT256 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX512 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float256;\n\ttypedef clongdouble Complex512;\n#endif\n\n\n\t/* End of typedefs for numarray style bit-width names */\n\n/* This is to typedef Intp to the appropriate pointer size for this platform.\n * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */\ntypedef Py_intptr_t intp;\ntypedef Py_uintptr_t uintp;\n\n#define INTP_STRFORMAT \"%d\"\n\n#if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n\t#define PyArray_INTP PyArray_INT\n\t#define PyArray_UINTP PyArray_UINT\n        #define PyIntpArrType_Type PyIntArrType_Type\n        #define PyUIntpArrType_Type PyUIntArrType_Type\n\t#define MAX_INTP MAX_INT\n\t#define MIN_INTP MIN_INT\n\t#define MAX_UINTP MAX_UINT\n#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG\n\t#define PyArray_INTP PyArray_LONG\n\t#define PyArray_UINTP PyArray_ULONG\n        #define PyIntpArrType_Type PyLongArrType_Type\n        #define PyUIntpArrType_Type PyULongArrType_Type\n\t#define MAX_INTP MAX_LONG\n\t#define MIN_INTP MIN_LONG\n\t#define MAX_UINTP MAX_ULONG\n#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)\n\t#define PyArray_INTP PyArray_LONGLONG\n\t#define PyArray_UINTP PyArray_ULONGLONG\n        #define PyIntpArrType_Type PyLongLongArrType_Type\n        #define PyUIntpArrType_Type PyULongLongArrType_Type\n\t#define MAX_INTP MAX_LONGLONG\n\t#define MIN_INTP MIN_LONGLONG\n\t#define MAX_UINTP MAX_ULONGLONG\n        #undef INTP_STRFORMAT\n        #define INTP_STRFORMAT \"%Ld\"\n#endif\n\n#define ERR(str) fprintf(stderr, #str); fflush(stderr);\n#define ERR2(str) fprintf(stderr, str); fflush(stderr);\n\n  /* Macros to define how array, and dimension/strides data is\n     allocated. \n  */\n\n  /* Data buffer */\n#define PyDataMem_NEW(size) ((char *)malloc(size))\n  /* #define PyArrayMem_NEW(size) PyMem_NEW(char, size)*/\n#define PyDataMem_FREE(ptr)  free(ptr)\n  /* #define PyArrayMem_FREE(ptr) PyMem_Free(ptr) */\n#define PyDataMem_RENEW(ptr,size) ((char *)realloc(ptr,size))\n\n  /* Dimensions and strides */\n#define PyDimMem_NEW(size) ((intp *)malloc(size*sizeof(intp)))\n#define PyDimMem_FREE(ptr) free(ptr)\n#define PyDimMem_RENEW(ptr,size) ((intp *)realloc(ptr,size*sizeof(intp)))\n\n\n  /* These must deal with unaligned and unbyteswapped data if necessary */\ntypedef PyObject * (PyArray_GetItemFunc) (char *, void *);\ntypedef int (PyArray_SetItemFunc)(PyObject *, char *, void *);\n\ntypedef int (PyArray_CompareFunc)(const void *, const void *, void *);\ntypedef void (PyArray_CopySwapNFunc)(void *, void *, intp, int, int);\ntypedef void (PyArray_CopySwapFunc)(void *, void *, int, int);\ntypedef Bool (PyArray_NonzeroFunc)(void *, void *);\n\n\n  /* These assume aligned and byteswapped data -- a buffer will be\n      used before or contiguous data will be obtained\n  */\ntypedef int (PyArray_ArgFunc)(void*, intp, intp*, void *);\ntypedef void (PyArray_DotFunc)(char *, intp, char *, intp, char *, intp, \n\t\t\t       void *);\ntypedef void (PyArray_VectorUnaryFunc)(void *, void *, intp, void *, void *);\ntypedef int (PyArray_ScanFunc)(FILE *, void *, int, char *, void *);\n\n\ntypedef struct {\n \tPyTypeObject *typeobj;  /* the type object for this type */\n\tchar kind;              /* kind for this type */\n\tchar type;              /* character representing this type */\n\tint type_num;           /* number representing this type */\n\tint elsize;             /* element size for this type -- \n\t\t\t\t   or 0 if variable */\n       \tint alignment;          /* alignment needed for this type */\n\n\t/* Functions to cast to all other standard types*/\n\tPyArray_VectorUnaryFunc *cast[PyArray_NTYPES];\n\n\t/* Functions to get and set items with standard\n\t   Python types -- not array scalars */\n\tPyArray_GetItemFunc *getitem;\n\tPyArray_SetItemFunc *setitem;\n\n\t/* Function to compare items */\n\tPyArray_CompareFunc *compare;\n\n  \t/* Function to select largest */\n\tPyArray_ArgFunc *argmax;\n\n\t/* Function to compute dot product */\n\tPyArray_DotFunc\t*dotfunc;\t   \n\t\n\t/* Function to scan an ASCII file and \n\t   place a single value plus possible separator */\n\tPyArray_ScanFunc *scanfunc;\n\n\t/* Copy and/or swap data.  Memory areas may not overlap */\n\t/*  Use memmove first if they might */\n\tPyArray_CopySwapNFunc *copyswapn;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\t/* Function to determine if data is zero or not */\n\tPyArray_NonzeroFunc *nonzero;\n\n} PyArray_Descr;\n\n\ntypedef struct PyArrayObject {\n\tPyObject_HEAD\n\tchar *data;             /* pointer to raw data buffer */\n\tint nd;                 /* number of dimensions, also called ndim */ \n\tintp *dimensions;       /* size in each dimension */\n        intp *strides;          /* bytes to jump to get to the \n\t\t\t\t   next element in each dimension */\n\tPyObject *base;         /* This object should be decref'd\n\t\t\t\t   upon deletion of array */\n\t                        /* For views it points to the original array */\n\t                        /* For creation from buffer object it points \n\t\t\t\t   to an object that shold be decref'd on \n\t\t\t\t   deletion */\n\t                        /* For UPDATEIFCOPY flag this is an array \n\t\t\t\t   to-be-updated upon deletion of this one */\n\tPyArray_Descr *descr;   /* Pointer to type structure */\n\tint flags;              /* Flags describing array -- see below*/\n\tint itemsize;           /* needed for Flexible size arrays:\n                                   CHAR, UNICODE, and VOID arrays\n \t\t\t         */ \n\tPyObject *weakreflist;  /* For weakreferences */\n\n} PyArrayObject;\n\n#define fortran fortran_  /* For some compilers */\n\ntypedef struct {   /* Just the type_num and itemsize variables \n\t\t      for use in the TypeNum Converter function */\n\tint type_num;\n\tint itemsize;\n\tint fortran;  /* Set to 1 if fortran-defined strides is desired */\n} PyArray_Typecode;\n\ntypedef struct {\n        intp *ptr;\n        int len;\n} PyArray_Dims;\n\n\n/* Mirrors buffer object to ptr */\n\ntypedef struct {\n        PyObject_HEAD\n        PyObject *base;\n        void *ptr;\n        intp len;\n        int flags;        \n} PyArray_Chunk;\n\n/* Array flags */\n#define CONTIGUOUS     1      /* means c-style contiguous (last index\n\t\t\t       varies the fastest) data elements right\n\t\t\t      after each other. */\n\n\t                      /* All 0-d arrays are CONTIGUOUS and FORTRAN\n\t\t\t\t contiguous.  If a 1-d array is CONTIGUOUS\n\t\t\t\t it is also FORTRAN contiguous \n\t\t\t      */\n\n\t/* Not used -- always assumed \n#define OWN_DIMENSIONS 2  \n#define OWN_STRIDES    4  \n\t*/\n\n#define OWNDATA        8\n#define OWN_DATA       OWNDATA\n\n#define FORTRAN    0x020    /* set if array is a contiguous Fortran array */\n\t                    /*  first index varies the fastest in memory\n\t\t\t        (strides array is reverse of C-contiguous\n\t\t\t           array)*/\n\n\t/* array never has these two set -- FromAny flags only */\n#define FORCECAST     0x040    \n#define ENSURECOPY    0x080 \t\n\n#define ALIGNED       0x100\n#define NOTSWAPPED    0x200\n#define WRITEABLE     0x400\n\n  /* Flag used in creating a new array, not set in the array */\n\n\t/* If this flags is set, then base contains a pointer to \n\t   an array of the same size that should be updated with the \n\t   current contents of this array when this array is deallocated\n\t*/\n#define UPDATEIFCOPY  0x1000\n\n\n/* Size of internal buffers used for alignment */\n#define PyArray_BUFSIZE 10000\n#define PyArray_MIN_BUFSIZE 5\n#define PyArray_MAX_BUFSIZE MAX_INT32\n#define MAXBUFNUM 1024\n\n\n#define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n#define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n#define CARRAY_FLAGS CONTIGUOUS | BEHAVED_FLAGS\n#define FARRAY_FLAGS FORTRAN | BEHAVED_FLAGS\n#define DEFAULT_FLAGS CARRAY_FLAGS\n\n#define UPDATE_ALL_FLAGS CONTIGUOUS | FORTRAN | ALIGNED\n\n\n/*\n * C API:  consists of Macros and functions.  The MACROS are defined here. \n */\n\n\n#define PyArray_CHKFLAGS(m, FLAGS) \\\n\t((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))\n#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, CONTIGUOUS)\n#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, WRITEABLE)\n\n#define PyArray_ISCARRAY(m) PyArray_CHKFLAGS(m, CARRAY_FLAGS)\n#define PyArray_ISFARRAY(m) PyArray_CHKFLAGS(m, FARRAY_FLAGS)\n#define PyArray_ISBEHAVED(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS)\n#define PyArray_ISBEHAVED_RO(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS_RO)\n\n\n#ifndef MAX\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#endif\n#ifndef MIN\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#endif\n\n        /* Useful if a and b have to be evaluated.  */\n\n#define tMAX(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_>_y_ ? _x_ : _y_}\n#define tMIN(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_<_y_ ? _x_ : _y_}\n\n#if defined(ALLOW_THREADS)\n#define BEGIN_THREADS_DEF PyThreadState *_save;\n#define BEGIN_THREADS _save = PyEval_SaveThread();\n#define END_THREADS   PyEval_RestoreThread(_save);\n#define ALLOW_C_API_DEF  PyGILState_STATE __save__;\n#define ALLOW_C_API      __save__ = PyGILState_Ensure();\n#define DISABLE_C_API    PyGILState_Release(__save__);\n#else\n#define BEGIN_THREADS_DEF\n#define BEGIN_THREADS\n#define END_THREADS\n#define ALLOW_C_API_DEF\n#define\tALLOW_C_API    \n#define\tDISABLE_C_API  \n#endif\n\ntypedef struct {\n        PyObject_HEAD\n\tint                     nd_m1;            /* number of dimensions - 1 */\n        intp\t\t        index, size;\n\tintp                    coordinates[MAX_DIMS];/* N-dimensional loop */\n        intp                    dims_m1[MAX_DIMS];    /* ao->dimensions - 1 */\n\tintp                    strides[MAX_DIMS];    /* ao->strides or fake */\n\tintp                    backstrides[MAX_DIMS];/* how far to jump back */\n\tintp                    factors[MAX_DIMS];     /* shape factors */\n\tPyArrayObject           *ao;\n\tchar                    *dataptr;        /* pointer to current item*/\n        unsigned char           contiguous;\n} PyArrayIterObject;\n\n\n/* Iterator API */ \n#define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type)\n\t\n#define PyArray_ITER_RESET(it) {\t\t\t\t\t\\\n\tit->index = 0;\t\t\t\t\t\t        \\\n\tit->dataptr = it->ao->data;\t\t\t\t\t\\\n\tmemset(it->coordinates, 0, (it->nd_m1+1)*sizeof(intp));\t\t\\\n}\n\n\n#define PyArray_ITER_NEXT(it) {\t\t\t\t\\\n\tit->index++;\t\t\t\t\t\\\n\tif (it->contiguous)  it->dataptr += it->ao->itemsize;\t       \\\n\telse {\t\t\t\t\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_ >= 0; _i_--) {\t\t\\\n\t\t\tif (it->coordinates[_i_] <\t\t\t\\\n\t\t\t    it->dims_m1[_i_]) {\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_]++;\t\t\t\\\n\t\t\t\tit->dataptr += it->strides[_i_];\t\\\n\t\t\t\tbreak;\t\t\t\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t\telse {\t\t\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_] = 0;\t\t\\\n\t\t\t\tit->dataptr -= it->backstrides[_i_];\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n}\n\n#define PyArray_ITER_GOTO(it, destination) {\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tit->index = 0;\t\t\t\t\t\t\\\n\t\tit->dataptr = it->ao->data;\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_>=0; _i_--) {\t\t\t\\\n\t\t\tit->dataptr += destination[_i_] *\t\t\\\n\t\t\t\tit->strides[_i_];\t\t\t\\\n\t\t\tit->coordinates[_i_] = destination[_i_];\t\\\n\t\t\tit->index += destination[_i_] *\t\t\t\\\n\t\t\t\t( _i_==it->nd_m1 ? 1 :\t\t\t\\\n\t\t\t\t  it->dims_m1[i+1]+1) ;\t  \t        \\\n\t\t}\t\t\t\t\t\t\t\\\n\t} \n\n#define PyArray_ITER_GOTO1D(it, ind) {                                  \\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tintp _lind_ = (intp) (ind);\t\t\t\t\\\n\t\tit->index = _lind_;\t\t\t\t\t\\\n\t\tif (it->contiguous)\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data + (ind) *\t\t\\\n\t\t\t\tit->ao->itemsize;\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data;\t\t\t\\\n\t\t\tfor (_i_ = 0; _i_<=it->nd_m1; _i_++) {\t\t\\\n\t\t\t\tit->dataptr += (_lind_ / it->factors[_i_]) \\\n\t\t\t\t\t* it->strides[_i_];\t\t\\\n\t\t\t\t_lind_ %= it->factors[_i_];\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n}\n\n/* Not constructed anywhere.  Just serves as a standard type that\n   PyArray_Broadcast expects.\n\n   Any object passed to PyArray_Broadcast must be binary compatible with \n   this structure.    \n*/\n\n\ntypedef struct {\n\tPyObject_HEAD\n\n\tint                     numiter;               /* number of iters */\n\tintp                    size;                  /* broadcasted size */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* iterators */\n} PyArrayMultiIterObject;  \n\t\n\n/* Store the information needed for fancy-indexing over an array */\n\ntypedef struct {\n\tPyObject_HEAD\n\t/* Multi-iterator portion --- needs to be present in this order to \n\t   work with PyArray_Broadcast */\n\n\tint                     numiter;               /* number of index-array\n\t\t\t\t\t\t\t  iterators */\n\tintp                    size;                  /* size of broadcasted \n\t\t\t\t\t\t\t  result */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* index object \n\t\t\t\t\t\t\t  iterators */\n\tPyArrayIterObject       *ait;                   /* flat Iterator for \n\t\t\t\t\t\t\t  underlying array */\n\n\t/* flat iterator for subspace (when numiter < nd) */\n\tPyArrayIterObject       *subspace;\n\n\t/* if subspace iteration, then this is the array of \n\t   axes in the underlying array represented by the\n\t   index objects */\n\tint                     iteraxes[MAX_DIMS];\n\t/* if subspace iteration, the these are the coordinates\n\t   to the start of the subspace.\n\t*/\n\tintp                    bscoord[MAX_DIMS];\n\n\t\n\tPyObject                *indexobj;             /* reference to \n\t\t\t\t\t\t\t  creating obj */\n\tint                     view;\n\tint                     consec;\n\tchar                    *dataptr;\n\n} PyArrayMapIterObject;\n\n\n/* Map Iterator API */ \n#define PyArrayMapIter_Check(op) PyObject_TypeCheck(op, &PyArrayMapIter_Type)\n\n\n#define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd)\n#define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, CONTIGUOUS) || \\\n\t\t\t\t PyArray_CHKFLAGS(m, FORTRAN))\n#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, FORTRAN) && (PyArray_NDIM(m) > 1))\n#define PyArray_DATA(obj) (((PyArrayObject *)(obj))->data)\n#define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions)\n#define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides)\n#define PyArray_DIM(obj,n) (((PyArrayObject *)(obj))->dimensions[n])\n#define PyArray_STRIDE(obj,n) (((PyArrayObject *)(obj))->strides[n])\n#define PyArray_BASE(obj) (((PyArrayObject *)(obj))->base)\n#define PyArray_DESCR(obj) (((PyArrayObject *)(obj))->descr)\n#define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags)\n#define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->itemsize)\n#define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num)\n#define PyArray_GETITEM(obj,itemptr)\t\t\t\\\n\t((PyArrayObject *)(obj))->descr->getitem((char *)itemptr,\t\\\n\t\t\t\t\t\t (PyArrayObject *)obj);\n#define PyArray_SETITEM(obj,itemptr,v)\t\t\t\t\t\\\n\t(obj)->descr->setitem((PyObject *)v,(char *)(itemptr),\t\t\\\n\t\t\t      (PyArrayObject *)(obj));\n\n\n#define PyTypeNum_ISBOOL(type) (type == PyArray_BOOL)\n#define PyTypeNum_ISUNSIGNED(type) ((type == PyArray_UBYTE) || \\\n\t\t\t\t (type == PyArray_USHORT) || \\\n\t\t\t\t (type == PyArray_UINT) ||\t\\\n\t\t\t\t (type == PyArray_ULONG) || \\\n\t\t\t\t (type == PyArray_ULONGLONG))\n\n#define PyTypeNum_ISSIGNED(type) ((type == PyArray_BYTE) ||\t\\\n\t\t\t       (type == PyArray_SHORT) ||\t\\\n\t\t\t       (type == PyArray_INT) ||\t\\\n\t\t\t       (type == PyArray_LONG) ||\t\\\n\t\t\t       (type == PyArray_LONGLONG))\n\n#define PyTypeNum_ISINTEGER(type) ((type >= PyArray_BYTE) &&\t\\\n\t\t\t\t(type <= PyArray_ULONGLONG))\n       \n#define PyTypeNum_ISFLOAT(type) ((type >= PyArray_FLOAT) &&  \\\n\t\t\t      (type <= PyArray_LONGDOUBLE))\n\n#define PyTypeNum_ISNUMBER(type) (type <= PyArray_CLONGDOUBLE)\n\n#define PyTypeNum_ISSTRING(type) ((type == PyArray_UCHAR) || \\\n\t\t\t       (type == PyArray_UNICODE))\n\n#define PyTypeNum_ISCOMPLEX(type) ((type >= PyArray_CFLOAT) && \\\n\t\t\t\t(type <= PyArray_CLONGDOUBLE))\n\t\n#define PyTypeNum_ISPYTHON(type) ((type == PyArray_LONG) || \\\n\t\t\t\t  (type == PyArray_DOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_CDOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_OBJECT ))\n\n#define PyTypeNum_ISFLEXIBLE(type) ((type==PyArray_STRING) || \\\n\t\t\t\t    (type==PyArray_UNICODE) ||\t\\\n\t\t\t\t    (type==PyArray_VOID))\n\n#define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \\\n\t\t\t\t   (type < PyArray_USERDEF+\\\n\t\t\t\t    PyArray_NUMUSERTYPES))\n\n#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) &&   \\\n\t\t\t\t     (type <= PyArray_VOID)) ||\t   \\\n\t\t\t\t    (type >= PyArray_USERDEF))\n\t\t\t\t    \n#define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT)\n\n#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))\n#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))\n#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))\n#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n#define PyArray_ISPYTHONTYPE(obj) PyTypeNum_ISPYTHONTYPE(PyArray_TYPE(obj))\n#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))\n\n/* Object arrays ignore notswapped flag */\n#define PyArray_ISNOTSWAPPED(m) (PyArray_CHKFLAGS(m, NOTSWAPPED) || \\\n\t\t\t\t PyArray_ISOBJECT(m))\n\n\n  /*  Often, rather than always convert to an array, \n      we may want to delegate behavior for other objects passed in\n  */\n\n\t/* \n\n#define Py_DELEGATE(op, name)                                     \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, NULL);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS(op, name, args)\t\t\t  \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, args);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS_KWDS(op, name, args, kwds)\t          \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_Call(meth, args, kwds);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\t*/\n\n\n        /* Includes the \"function\" C-API -- these are all stored in a \n\t   list of pointers --- one for each file\n\t   The two lists are concatenated into one in multiarray.\n\t   \n\t   They are available as import_array()\n         */\n\n#include \"__multiarray_api.h\"\n\n\n        /* C-API that requries previous API to be defined */\n\n#define PyArray_Check(op) (PyObject_TypeCheck((op), &PyBigArray_Type))\n#define PyBigArray_CheckExact(op) ((op)->ob_type == &PyBigArray_Type)\n#define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type)\n\n#define PyArray_CheckScalar(m) (PyObject_TypeCheck((m),\t\t\t\\\n\t\t\t\t\t\t   &PyGenericArrType_Type) \\\n\t\t\t\t|| ((PyArray_Check((m))) &&\t\t\\\n\t\t\t\t    (((PyArrayObject *)(m))->nd == 0)))\n#define PyArray_IsScalar(obj, cls)\t\t\t\t\\\n\t(PyObject_TypeCheck((obj), &Py##cls##ArrType_Type))\n#define PyArray_IsPythonScalar(obj) \\\n\t(PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \\\n\t PyLong_Check(obj) || PyBool_Check(obj) || PyString_Check(obj) || \\\n\t PyUnicode_Check(obj))\n#define PyArray_IsAnyScalar(obj) \\\n\t(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))\n\n#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \\\n\t  (PyArrayObject *)(PyArray_ContiguousFromObject((PyObject *)(m), \\\n\t\t                      PyArray_TYPE(m), 0, 0))) \n\n#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))\n#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))\n#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0)\n#define PyArray_FROM_OF(m,flags) PyArray_FromAny(m, NULL, 0, 0, flags)\n\n#define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)\n#define MAX_ELSIZE 2*SIZEOF_LONGDOUBLE\n\n#define PyArray_SimpleNew(nd, dims, typenum) \\\n\tPyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)\n\n        /*Compatibility with old Numeric stuff -- don't use in new code */\n\n#define PyArray_UNSIGNED_TYPES\n#define PyArray_SBYTE PyArray_BYTE\n#define PyArray_CHAR PyArray_BYTE\n#define PyArray_CopyArray PyArray_CopyInto\n#define _PyArray_multiply_list PyArray_MultiplyIntList\n#define PyArray_ISSPACESAVER(m) FALSE\n#define PyScalarArray_Check PyArray_CheckScalar\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !Py_ARRAYOBJECT_H */\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 252,
                "complexity": 0,
                "token_count": 1156,
                "diff_parsed": {
                    "added": [
                        "#define FORTRAN    2    /* set if array is a contiguous Fortran array */",
                        "                       /*  first index varies the fastest in memory",
                        "                           (strides array is reverse of C-contiguous",
                        "\t\t\t           array)*/",
                        "#define OWNDATA        4",
                        "\t/* array never has these three set -- FromAny flags only */",
                        "#define FORCECAST     0x010",
                        "#define ENSURECOPY    0x020",
                        "#define ENSUREARRAY   0x040"
                    ],
                    "deleted": [
                        "\t/* Not used -- always assumed",
                        "#define OWN_DIMENSIONS 2",
                        "#define OWN_STRIDES    4",
                        "\t*/",
                        "#define OWNDATA        8",
                        "#define FORTRAN    0x020    /* set if array is a contiguous Fortran array */",
                        "\t                    /*  first index varies the fastest in memory",
                        "\t\t\t        (strides array is reverse of C-contiguous",
                        "\t\t\t           array)*/",
                        "",
                        "\t/* array never has these two set -- FromAny flags only */",
                        "#define FORCECAST     0x040",
                        "#define ENSURECOPY    0x080",
                        "  /* Flag used in creating a new array, not set in the array */"
                    ]
                }
            },
            {
                "old_path": "scipy/base/matrix.py",
                "new_path": "scipy/base/matrix.py",
                "filename": "matrix.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -84,7 +84,7 @@ def __new__(self, data, dtype=None, copy=0):\n \n         ret = N.ndarray.__new__(matrix, shape, arr.dtype, buffer=arr,\n                                 fortran=fortran,\n-                                swap=(not arr.flags['NOTSWAPPED']))\n+                                swap=arr.flags['S'])\n         return ret; \n \n \n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "\nimport numeric as N\nfrom numeric import ArrayType, concatenate, integer, multiply, power\nfrom type_check import isscalar\nfrom function_base import binary_repr\nimport types\nimport string as str_\nimport sys\n\n__all__ = ['matrix', 'bmat', 'mat']\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)\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\n\nclass matrix(N.ndarray):\n    __array_priority__ = 10.0\n    def __new__(self, data, dtype=None, copy=0):\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__(matrix, shape, arr.dtype, buffer=arr,\n                                fortran=fortran,\n                                swap=arr.flags['S'])\n        return ret; \n\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 inde\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 scipy import linalg\n        return matrix(linalg.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\n        \n",
                "source_code_before": "\nimport numeric as N\nfrom numeric import ArrayType, concatenate, integer, multiply, power\nfrom type_check import isscalar\nfrom function_base import binary_repr\nimport types\nimport string as str_\nimport sys\n\n__all__ = ['matrix', 'bmat', 'mat']\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)\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\n\nclass matrix(N.ndarray):\n    __array_priority__ = 10.0\n    def __new__(self, data, dtype=None, copy=0):\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__(matrix, shape, arr.dtype, buffer=arr,\n                                fortran=fortran,\n                                swap=(not arr.flags['NOTSWAPPED']))\n        return ret; \n\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 inde\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 scipy import linalg\n        return matrix(linalg.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\n        \n",
                "methods": [
                    {
                        "name": "_eval",
                        "long_name": "_eval( astr )",
                        "filename": "matrix.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": "matrix.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": "__new__",
                        "long_name": "__new__( self , data , dtype = None , copy = 0 )",
                        "filename": "matrix.py",
                        "nloc": 32,
                        "complexity": 15,
                        "token_count": 244,
                        "parameters": [
                            "self",
                            "data",
                            "dtype",
                            "copy"
                        ],
                        "start_line": 50,
                        "end_line": 88,
                        "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": "matrix.py",
                        "nloc": 7,
                        "complexity": 3,
                        "token_count": 46,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 91,
                        "end_line": 97,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , index )",
                        "filename": "matrix.py",
                        "nloc": 18,
                        "complexity": 9,
                        "token_count": 135,
                        "parameters": [
                            "self",
                            "index"
                        ],
                        "start_line": 99,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__mul__",
                        "long_name": "__mul__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 5,
                        "complexity": 3,
                        "token_count": 43,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 119,
                        "end_line": 123,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__rmul__",
                        "long_name": "__rmul__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 5,
                        "complexity": 3,
                        "token_count": 43,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 125,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__imul__",
                        "long_name": "__imul__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 17,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 131,
                        "end_line": 133,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__pow__",
                        "long_name": "__pow__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 32,
                        "complexity": 11,
                        "token_count": 205,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 135,
                        "end_line": 168,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__rpow__",
                        "long_name": "__rpow__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 9,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 170,
                        "end_line": 171,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__repr__",
                        "long_name": "__repr__( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 173,
                        "end_line": 174,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__str__",
                        "long_name": "__str__( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 14,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 176,
                        "end_line": 177,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "tolist",
                        "long_name": "tolist( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 15,
                        "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": "getA",
                        "long_name": "getA( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 11,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 184,
                        "end_line": 185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "getT",
                        "long_name": "getT( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 11,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 187,
                        "end_line": 188,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "getH",
                        "long_name": "getH( self )",
                        "filename": "matrix.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 35,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 190,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "getI",
                        "long_name": "getI( self )",
                        "filename": "matrix.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 196,
                        "end_line": 198,
                        "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": "matrix.py",
                        "nloc": 22,
                        "complexity": 6,
                        "token_count": 132,
                        "parameters": [
                            "str",
                            "gdict",
                            "ldict"
                        ],
                        "start_line": 206,
                        "end_line": 228,
                        "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": "matrix.py",
                        "nloc": 20,
                        "complexity": 7,
                        "token_count": 155,
                        "parameters": [
                            "obj",
                            "ldict",
                            "gdict"
                        ],
                        "start_line": 231,
                        "end_line": 265,
                        "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": "matrix.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": "matrix.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": "__new__",
                        "long_name": "__new__( self , data , dtype = None , copy = 0 )",
                        "filename": "matrix.py",
                        "nloc": 32,
                        "complexity": 15,
                        "token_count": 247,
                        "parameters": [
                            "self",
                            "data",
                            "dtype",
                            "copy"
                        ],
                        "start_line": 50,
                        "end_line": 88,
                        "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": "matrix.py",
                        "nloc": 7,
                        "complexity": 3,
                        "token_count": 46,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 91,
                        "end_line": 97,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , index )",
                        "filename": "matrix.py",
                        "nloc": 18,
                        "complexity": 9,
                        "token_count": 135,
                        "parameters": [
                            "self",
                            "index"
                        ],
                        "start_line": 99,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__mul__",
                        "long_name": "__mul__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 5,
                        "complexity": 3,
                        "token_count": 43,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 119,
                        "end_line": 123,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__rmul__",
                        "long_name": "__rmul__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 5,
                        "complexity": 3,
                        "token_count": 43,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 125,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__imul__",
                        "long_name": "__imul__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 17,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 131,
                        "end_line": 133,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__pow__",
                        "long_name": "__pow__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 32,
                        "complexity": 11,
                        "token_count": 205,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 135,
                        "end_line": 168,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__rpow__",
                        "long_name": "__rpow__( self , other )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 9,
                        "parameters": [
                            "self",
                            "other"
                        ],
                        "start_line": 170,
                        "end_line": 171,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__repr__",
                        "long_name": "__repr__( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 173,
                        "end_line": 174,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__str__",
                        "long_name": "__str__( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 14,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 176,
                        "end_line": 177,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "tolist",
                        "long_name": "tolist( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 15,
                        "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": "getA",
                        "long_name": "getA( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 11,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 184,
                        "end_line": 185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "getT",
                        "long_name": "getT( self )",
                        "filename": "matrix.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 11,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 187,
                        "end_line": 188,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "getH",
                        "long_name": "getH( self )",
                        "filename": "matrix.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 35,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 190,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "getI",
                        "long_name": "getI( self )",
                        "filename": "matrix.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 196,
                        "end_line": 198,
                        "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": "matrix.py",
                        "nloc": 22,
                        "complexity": 6,
                        "token_count": 132,
                        "parameters": [
                            "str",
                            "gdict",
                            "ldict"
                        ],
                        "start_line": 206,
                        "end_line": 228,
                        "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": "matrix.py",
                        "nloc": 20,
                        "complexity": 7,
                        "token_count": 155,
                        "parameters": [
                            "obj",
                            "ldict",
                            "gdict"
                        ],
                        "start_line": 231,
                        "end_line": 265,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "__new__",
                        "long_name": "__new__( self , data , dtype = None , copy = 0 )",
                        "filename": "matrix.py",
                        "nloc": 32,
                        "complexity": 15,
                        "token_count": 244,
                        "parameters": [
                            "self",
                            "data",
                            "dtype",
                            "copy"
                        ],
                        "start_line": 50,
                        "end_line": 88,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 1
                    }
                ],
                "nloc": 209,
                "complexity": 73,
                "token_count": 1460,
                "diff_parsed": {
                    "added": [
                        "                                swap=arr.flags['S'])"
                    ],
                    "deleted": [
                        "                                swap=(not arr.flags['NOTSWAPPED']))"
                    ]
                }
            },
            {
                "old_path": "scipy/base/numeric.py",
                "new_path": "scipy/base/numeric.py",
                "filename": "numeric.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -27,35 +27,17 @@\n register_dtype = multiarray.register_dtype\n can_cast = multiarray.can_cast\n \n-\n def asarray(a, dtype=None):\n     \"\"\"asarray(a,dtype=None) returns a as an array.  Unlike array(),\n-    no copy is performed if a is already an array.  Will return a subclass\n-    of array. \n+    no copy is performed if a is already an array.  Subclasses are converted\n+    to base class ndarray.\n     \"\"\"\n     return array(a, dtype, copy=0)\n \n-def asndarray(a, dtype=None):\n-    \"\"\"asndarray(a, dtype=None) always returns an actual ndarray object.\n-    No copy is performed if a is already an array.\n-    Meant primarily for debugging.     \n+def asanyarray(a, dtype=None):\n+    \"\"\"will pass subclasses through...\n     \"\"\"\n-    dtype = obj2dtype(dtype)\n-    # exact check\n-    while 1:\n-        if type(a) is ndarray:\n-            if dtype is None or a.dtype is dtype:\n-                return a\n-            else:\n-                return a.astype(dtype)\n-        try:\n-            if dtype is None:\n-                return a.__array__()\n-            else:\n-                return a.__array__(dtype)\n-        except AttributeError:\n-            a = array(a,dtype)  # copy irrelevant\n-            dtype = None\n+    return array(a, dtype, copy=0, subok=1)\n \n def isfortran(a):\n     return a.flags['FNC']\n@@ -66,9 +48,9 @@ def zeros_like(a):\n \n     If you don't explicitly need the array to be zeroed, you should instead\n     use empty_like(), which is faster as it only allocates memory.\"\"\"\n-\n-    a = asarray(a)\n-    return zeros(a.shape,a.dtype, a.flags['FNC'])\n+    \n+    a = asanyarray(a)\n+    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n \n def empty_like(a):\n     \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n@@ -77,8 +59,8 @@ def empty_like(a):\n     your array to be initialized, you should use zeros_like().\n \n     \"\"\"\n-    a = asarray(a)\n-    return empty(a.shape,a.dtype, a.flags['FNC'])\n+    a = asanyarray(a)\n+    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n \n # end Fernando's utilities\n \n",
                "added_lines": 10,
                "deleted_lines": 28,
                "source_code": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None):\n    \"\"\"asarray(a,dtype=None) returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0)\n\ndef asanyarray(a, dtype=None):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asndarray(a)\n   b = asndarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asndarray(a), axisa)\n    b = _move_axis_to_0(asndarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "source_code_before": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\n\ndef asarray(a, dtype=None):\n    \"\"\"asarray(a,dtype=None) returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Will return a subclass\n    of array. \n    \"\"\"\n    return array(a, dtype, copy=0)\n\ndef asndarray(a, dtype=None):\n    \"\"\"asndarray(a, dtype=None) always returns an actual ndarray object.\n    No copy is performed if a is already an array.\n    Meant primarily for debugging.     \n    \"\"\"\n    dtype = obj2dtype(dtype)\n    # exact check\n    while 1:\n        if type(a) is ndarray:\n            if dtype is None or a.dtype is dtype:\n                return a\n            else:\n                return a.astype(dtype)\n        try:\n            if dtype is None:\n                return a.__array__()\n            else:\n                return a.__array__(dtype)\n        except AttributeError:\n            a = array(a,dtype)  # copy irrelevant\n            dtype = None\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n\n    a = asarray(a)\n    return zeros(a.shape,a.dtype, a.flags['FNC'])\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asarray(a)\n    return empty(a.shape,a.dtype, a.flags['FNC'])\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asndarray(a)\n   b = asndarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asndarray(a), axisa)\n    b = _move_axis_to_0(asndarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "methods": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 42,
                        "end_line": 43,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 71,
                        "end_line": 74,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 76,
                        "end_line": 78,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 81,
                        "end_line": 89,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 104,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 116,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 118,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 122,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 182,
                        "end_line": 198,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 210,
                        "end_line": 218,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 220,
                        "end_line": 230,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 237,
                        "end_line": 240,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 246,
                        "end_line": 253,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 255,
                        "end_line": 261,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 263,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 287,
                        "end_line": 306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 310,
                        "end_line": 327,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 329,
                        "end_line": 343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 347,
                        "end_line": 358,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 31,
                        "end_line": 36,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asndarray",
                        "long_name": "asndarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 7,
                        "token_count": 85,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 38,
                        "end_line": 58,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 60,
                        "end_line": 61,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 30,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 64,
                        "end_line": 71,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 30,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 73,
                        "end_line": 81,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 89,
                        "end_line": 92,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 94,
                        "end_line": 96,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 99,
                        "end_line": 107,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 113,
                        "end_line": 120,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 122,
                        "end_line": 126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 134,
                        "end_line": 135,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 136,
                        "end_line": 137,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 140,
                        "end_line": 147,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 149,
                        "end_line": 187,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 216,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 218,
                        "end_line": 219,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 228,
                        "end_line": 236,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 238,
                        "end_line": 248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 255,
                        "end_line": 258,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 264,
                        "end_line": 271,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 273,
                        "end_line": 279,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 281,
                        "end_line": 292,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 305,
                        "end_line": 324,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 328,
                        "end_line": 345,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 347,
                        "end_line": 361,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 365,
                        "end_line": 376,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "asndarray",
                        "long_name": "asndarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 7,
                        "token_count": 85,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 38,
                        "end_line": 58,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 240,
                "complexity": 64,
                "token_count": 1937,
                "diff_parsed": {
                    "added": [
                        "    no copy is performed if a is already an array.  Subclasses are converted",
                        "    to base class ndarray.",
                        "def asanyarray(a, dtype=None):",
                        "    \"\"\"will pass subclasses through...",
                        "    return array(a, dtype, copy=0, subok=1)",
                        "",
                        "    a = asanyarray(a)",
                        "    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))",
                        "    a = asanyarray(a)",
                        "    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))"
                    ],
                    "deleted": [
                        "",
                        "    no copy is performed if a is already an array.  Will return a subclass",
                        "    of array.",
                        "def asndarray(a, dtype=None):",
                        "    \"\"\"asndarray(a, dtype=None) always returns an actual ndarray object.",
                        "    No copy is performed if a is already an array.",
                        "    Meant primarily for debugging.",
                        "    dtype = obj2dtype(dtype)",
                        "    # exact check",
                        "    while 1:",
                        "        if type(a) is ndarray:",
                        "            if dtype is None or a.dtype is dtype:",
                        "                return a",
                        "            else:",
                        "                return a.astype(dtype)",
                        "        try:",
                        "            if dtype is None:",
                        "                return a.__array__()",
                        "            else:",
                        "                return a.__array__(dtype)",
                        "        except AttributeError:",
                        "            a = array(a,dtype)  # copy irrelevant",
                        "            dtype = None",
                        "",
                        "    a = asarray(a)",
                        "    return zeros(a.shape,a.dtype, a.flags['FNC'])",
                        "    a = asarray(a)",
                        "    return empty(a.shape,a.dtype, a.flags['FNC'])"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/arrayobject.c",
                "new_path": "scipy/base/src/arrayobject.c",
                "filename": "arrayobject.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -3532,8 +3532,8 @@ array_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)\n         return PyArray_Return(ret);\n         \n  fail:\n-        if (dims.ptr) free(dims.ptr);\n-        if (strides.ptr) free(strides.ptr);\n+        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n+        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n         return NULL;\n }\n \n@@ -4857,7 +4857,7 @@ PyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at)\n \tPyObject *out;\n \tint ret;\n \n-\tif ((mp->descr->type_num == at->type_num) && \\\n+\tif ((mp->descr->type_num == at->type_num) &&                    \\\n \t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n \t    PyArray_ISBEHAVED_RO(mp)) {\n \t\tPy_INCREF(mp);\n@@ -4953,11 +4953,14 @@ array_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags)\n \tint arrflags;\n \tPyArray_Typecode oldtype;\n \tchar *msg = \"Cannot copy-back to a read-only array.\";\n+        PyTypeObject *subtype;\n \n \toldtype.type_num = PyArray_TYPE(arr);\n \toldtype.itemsize = PyArray_ITEMSIZE(arr);\n \toldtype.fortran = 0;\n \n+        subtype = arr->ob_type;\n+\n \tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n \tif (itemsize == 0) itemsize = arr->itemsize;\n \ttypecode->type_num = type;\n@@ -4982,8 +4985,12 @@ array_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags)\n                                 PyErr_SetString(PyExc_ValueError, msg);\n                                 return NULL;\n                         }\n-\t\t\tret = (PyArrayObject *)\\\n-\t\t\t\tPyArray_New(arr->ob_type, \n+                        if ((flags & ENSUREARRAY) && \\\n+                            (subtype != &PyBigArray_Type)) {\n+                                subtype = &PyArray_Type;\n+                        }\n+\t\t\tret = (PyArrayObject *)         \\\n+\t\t\t\tPyArray_New(subtype, \n \t\t\t\t\t    arr->nd, \n \t\t\t\t\t    arr->dimensions,\n \t\t\t\t\t    arr->descr->type_num,\n@@ -5002,8 +5009,25 @@ array_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags)\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+                                ret = (PyArrayObject *) \\\n+                                        PyArray_New(&PyArray_Type,\n+                                                    arr->nd,\n+                                                    arr->dimensions,\n+                                                    arr->descr->type_num,\n+                                                    arr->strides,\n+                                                    arr->data,\n+                                                    arr->itemsize,\n+                                                    arr->flags,NULL);\n+                                if (ret == NULL) return NULL;\n+                                ret->base = (PyObject *)arr;\n+                                ret->flags &= ~UPDATEIFCOPY;\n+                        }\n+                        else {\n+                                ret = arr;\n+                        }\n \t\t\tPy_INCREF(arr);\n-\t\t\tret = arr;\n \t\t}\n \t}\n \t\n@@ -5020,8 +5044,21 @@ array_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags)\n                                 PyErr_SetString(PyExc_ValueError, msg);\n                                 return NULL;\n                         }\n-\t\t\tret = (PyArrayObject *)\\\n-\t\t\t\tPyArray_CastToType(arr, typecode);\n+                        if ((flags & ENSUREARRAY) && \\\n+                            (subtype != &PyBigArray_Type)) {\n+                                subtype = &PyArray_Type;\n+                        }\n+                        ret = (PyArrayObject *)\\\n+                                PyArray_New(subtype, arr->nd,\n+                                            arr->dimensions, typecode->type_num,\n+                                            NULL, NULL, typecode->itemsize,\n+                                            typecode->fortran, \n+                                            (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@@ -5031,7 +5068,7 @@ array_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags)\n \t\t}\n \t\telse {\n \t\t\tPyErr_SetString(PyExc_TypeError, \n-\t\t\t\t\t\"Array can not be safely cast \"\\\n+\t\t\t\t\t\"Array can not be safely cast \" \\\n \t\t\t\t\t\"to required type\");\n \t\t\tret = NULL;\n \t\t}\n@@ -5440,6 +5477,7 @@ PyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth,\n /* This is a quick wrapper around PyArray_FromAny(op, NULL, 0, 0, 0) */\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@@ -5451,14 +5489,14 @@ PyArray_EnsureArray(PyObject *op)\n \n         if (op == NULL) return NULL;\n \n-        if (PyArray_Check(op)) return op;\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_FromAny(op, NULL, 0, 0, 0);\n+        new = PyArray_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n         Py_DECREF(op);\n         return new;\n }\n",
                "added_lines": 50,
                "deleted_lines": 12,
                "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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tPyObject_Del(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\treturn PyErr_NoMemory();\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\tPyObject_Del(self);\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\treturn NULL;\n\t\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\tif (self->dimensions != NULL) \n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, BEHAVED_FLAGS);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, DEFAULT_FLAGS);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t     ENSURECOPY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\n        switch(fromtype) {\n        case PyArray_BYTE:\n\tcase PyArray_SHORT:\n        case PyArray_INT:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {\n\t\t\t\treturn (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize > from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) > from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) >= from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\n        case PyArray_UBYTE:\n        case PyArray_USHORT:\n        case PyArray_UINT:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISSIGNED(totype)) {\n\t\t\t\treturn (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize > from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) > from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tPyObject_Del(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\treturn PyErr_NoMemory();\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\tPyObject_Del(self);\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\treturn NULL;\n\t\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\tif (self->dimensions != NULL) \n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) free(dims.ptr);\n        if (strides.ptr) free(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) && \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                PyErr_SetString(PyExc_ValueError, msg);\n                                return NULL;\n                        }\n\t\t\tret = (PyArrayObject *)\\\n\t\t\t\tPyArray_New(arr->ob_type, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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\t\t\tPy_INCREF(arr);\n\t\t\tret = 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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\n                                PyErr_SetString(PyExc_ValueError, msg);\n                                return NULL;\n                        }\n\t\t\tret = (PyArrayObject *)\\\n\t\t\t\tPyArray_CastToType(arr, typecode);\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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\n/*  that special cases Arrays and PyArray_Scalars up front */\n/*  It steals a reference to the object */\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\nstatic PyObject *\nPyArray_EnsureArray(PyObject *op)\n{\n        PyObject *new;\n\n        if (op == NULL) return NULL;\n\n        if (PyArray_Check(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_FromAny(op, NULL, 0, 0, 0);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, BEHAVED_FLAGS);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, DEFAULT_FLAGS);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t     ENSURECOPY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\n        switch(fromtype) {\n        case PyArray_BYTE:\n\tcase PyArray_SHORT:\n        case PyArray_INT:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {\n\t\t\t\treturn (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize > from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) > from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) >= from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\n        case PyArray_UBYTE:\n        case PyArray_USHORT:\n        case PyArray_UINT:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISSIGNED(totype)) {\n\t\t\t\treturn (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize > from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) > from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\n\n",
                "methods": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 112,
                        "complexity": 28,
                        "token_count": 672,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3288,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 145,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3293,
                        "end_line": 3398,
                        "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": 3402,
                        "end_line": 3419,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3423,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3545,
                        "end_line": 3548,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3551,
                        "end_line": 3561,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3634,
                        "end_line": 3637,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3641,
                        "end_line": 3675,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3679,
                        "end_line": 3682,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3685,
                        "end_line": 3718,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3722,
                        "end_line": 3729,
                        "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": 3732,
                        "end_line": 3740,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3744,
                        "end_line": 3758,
                        "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": 3761,
                        "end_line": 3805,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3809,
                        "end_line": 3812,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3815,
                        "end_line": 3822,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3826,
                        "end_line": 3833,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3836,
                        "end_line": 3856,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3859,
                        "end_line": 3881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3884,
                        "end_line": 3887,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3891,
                        "end_line": 3894,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3906,
                        "end_line": 3964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3969,
                        "end_line": 3979,
                        "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": 3983,
                        "end_line": 4008,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4012,
                        "end_line": 4044,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4047,
                        "end_line": 4082,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4085,
                        "end_line": 4122,
                        "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": 4125,
                        "end_line": 4128,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4131,
                        "end_line": 4185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4364,
                        "end_line": 4389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4392,
                        "end_line": 4414,
                        "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": 4421,
                        "end_line": 4447,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4450,
                        "end_line": 4470,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4473,
                        "end_line": 4614,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4617,
                        "end_line": 4640,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4644,
                        "end_line": 4667,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4671,
                        "end_line": 4728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4732,
                        "end_line": 4739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4745,
                        "end_line": 4835,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4841,
                        "end_line": 4852,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4855,
                        "end_line": 4890,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4897,
                        "end_line": 4943,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4946,
                        "end_line": 5077,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5081,
                        "end_line": 5186,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5189,
                        "end_line": 5284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5287,
                        "end_line": 5308,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5312,
                        "end_line": 5374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5377,
                        "end_line": 5382,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5385,
                        "end_line": 5391,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5445,
                        "end_line": 5475,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5486,
                        "end_line": 5502,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5508,
                        "end_line": 5514,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5517,
                        "end_line": 5524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5527,
                        "end_line": 5534,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 99,
                        "complexity": 43,
                        "token_count": 578,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5540,
                        "end_line": 5641,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 102,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5644,
                        "end_line": 5668,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5678,
                        "end_line": 5715,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5720,
                        "end_line": 5730,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5733,
                        "end_line": 5738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5741,
                        "end_line": 5746,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5750,
                        "end_line": 5753,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5757,
                        "end_line": 5805,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5808,
                        "end_line": 5861,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5865,
                        "end_line": 5984,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5988,
                        "end_line": 6020,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6023,
                        "end_line": 6065,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6069,
                        "end_line": 6191,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6204,
                        "end_line": 6246,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6251,
                        "end_line": 6255,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6320,
                        "end_line": 6381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6389,
                        "end_line": 6404,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6410,
                        "end_line": 6479,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6483,
                        "end_line": 6519,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6525,
                        "end_line": 6569,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6587,
                        "end_line": 6723,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6729,
                        "end_line": 6798,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6801,
                        "end_line": 6934,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6940,
                        "end_line": 6970,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6976,
                        "end_line": 6987,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6990,
                        "end_line": 6999,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 7002,
                        "end_line": 7020,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 112,
                        "complexity": 28,
                        "token_count": 672,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3288,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 145,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3293,
                        "end_line": 3398,
                        "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": 3402,
                        "end_line": 3419,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3423,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3545,
                        "end_line": 3548,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3551,
                        "end_line": 3561,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3634,
                        "end_line": 3637,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3641,
                        "end_line": 3675,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3679,
                        "end_line": 3682,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3685,
                        "end_line": 3718,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3722,
                        "end_line": 3729,
                        "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": 3732,
                        "end_line": 3740,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3744,
                        "end_line": 3758,
                        "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": 3761,
                        "end_line": 3805,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3809,
                        "end_line": 3812,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3815,
                        "end_line": 3822,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3826,
                        "end_line": 3833,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3836,
                        "end_line": 3856,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3859,
                        "end_line": 3881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3884,
                        "end_line": 3887,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3891,
                        "end_line": 3894,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3906,
                        "end_line": 3964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3969,
                        "end_line": 3979,
                        "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": 3983,
                        "end_line": 4008,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4012,
                        "end_line": 4044,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4047,
                        "end_line": 4082,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4085,
                        "end_line": 4122,
                        "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": 4125,
                        "end_line": 4128,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4131,
                        "end_line": 4185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4364,
                        "end_line": 4389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4392,
                        "end_line": 4414,
                        "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": 4421,
                        "end_line": 4447,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4450,
                        "end_line": 4470,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4473,
                        "end_line": 4614,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4617,
                        "end_line": 4640,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4644,
                        "end_line": 4667,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4671,
                        "end_line": 4728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4732,
                        "end_line": 4739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4745,
                        "end_line": 4835,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4841,
                        "end_line": 4852,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4855,
                        "end_line": 4890,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4897,
                        "end_line": 4943,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 80,
                        "complexity": 26,
                        "token_count": 522,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4946,
                        "end_line": 5040,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 95,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5044,
                        "end_line": 5149,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5152,
                        "end_line": 5247,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5250,
                        "end_line": 5271,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5275,
                        "end_line": 5337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5340,
                        "end_line": 5345,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5348,
                        "end_line": 5354,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5408,
                        "end_line": 5438,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 82,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5448,
                        "end_line": 5464,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5470,
                        "end_line": 5476,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5479,
                        "end_line": 5486,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5489,
                        "end_line": 5496,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 99,
                        "complexity": 43,
                        "token_count": 578,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5502,
                        "end_line": 5603,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 102,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5606,
                        "end_line": 5630,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5640,
                        "end_line": 5677,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5682,
                        "end_line": 5692,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5695,
                        "end_line": 5700,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5703,
                        "end_line": 5708,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5712,
                        "end_line": 5715,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5719,
                        "end_line": 5767,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5770,
                        "end_line": 5823,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5827,
                        "end_line": 5946,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5950,
                        "end_line": 5982,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5985,
                        "end_line": 6027,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6031,
                        "end_line": 6153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6166,
                        "end_line": 6208,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6213,
                        "end_line": 6217,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6282,
                        "end_line": 6343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6351,
                        "end_line": 6366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6372,
                        "end_line": 6441,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6445,
                        "end_line": 6481,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6487,
                        "end_line": 6531,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6549,
                        "end_line": 6685,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6691,
                        "end_line": 6760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6763,
                        "end_line": 6896,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6902,
                        "end_line": 6932,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6938,
                        "end_line": 6949,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6952,
                        "end_line": 6961,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6964,
                        "end_line": 6982,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3423,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4946,
                        "end_line": 5077,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5486,
                        "end_line": 5502,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4855,
                        "end_line": 4890,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 5567,
                "complexity": 1225,
                "token_count": 33293,
                "diff_parsed": {
                    "added": [
                        "        if (dims.ptr) PyDimMem_FREE(dims.ptr);",
                        "        if (strides.ptr) PyDimMem_FREE(strides.ptr);",
                        "\tif ((mp->descr->type_num == at->type_num) &&                    \\",
                        "        PyTypeObject *subtype;",
                        "        subtype = arr->ob_type;",
                        "",
                        "                        if ((flags & ENSUREARRAY) && \\",
                        "                            (subtype != &PyBigArray_Type)) {",
                        "                                subtype = &PyArray_Type;",
                        "                        }",
                        "\t\t\tret = (PyArrayObject *)         \\",
                        "\t\t\t\tPyArray_New(subtype,",
                        "                        if ((flags & ENSUREARRAY) && \\",
                        "                            (subtype != &PyBigArray_Type)) {",
                        "                                ret = (PyArrayObject *) \\",
                        "                                        PyArray_New(&PyArray_Type,",
                        "                                                    arr->nd,",
                        "                                                    arr->dimensions,",
                        "                                                    arr->descr->type_num,",
                        "                                                    arr->strides,",
                        "                                                    arr->data,",
                        "                                                    arr->itemsize,",
                        "                                                    arr->flags,NULL);",
                        "                                if (ret == NULL) return NULL;",
                        "                                ret->base = (PyObject *)arr;",
                        "                                ret->flags &= ~UPDATEIFCOPY;",
                        "                        }",
                        "                        else {",
                        "                                ret = arr;",
                        "                        }",
                        "                        if ((flags & ENSUREARRAY) && \\",
                        "                            (subtype != &PyBigArray_Type)) {",
                        "                                subtype = &PyArray_Type;",
                        "                        }",
                        "                        ret = (PyArrayObject *)\\",
                        "                                PyArray_New(subtype, arr->nd,",
                        "                                            arr->dimensions, typecode->type_num,",
                        "                                            NULL, NULL, typecode->itemsize,",
                        "                                            typecode->fortran,",
                        "                                            (PyObject *)arr);",
                        "                        if (ret == NULL) return NULL;",
                        "                        if (PyArray_CastTo(ret, arr) < 0) {",
                        "                                Py_DECREF(ret);",
                        "                                return NULL;",
                        "                        }",
                        "\t\t\t\t\t\"Array can not be safely cast \" \\",
                        "/*  It also guarantees that the result is PyArray_Type or PyBigArray_Type */",
                        "        if (PyArray_CheckExact(op) || PyBigArray_CheckExact(op)) return op;",
                        "",
                        "        new = PyArray_FromAny(op, NULL, 0, 0, ENSUREARRAY);"
                    ],
                    "deleted": [
                        "        if (dims.ptr) free(dims.ptr);",
                        "        if (strides.ptr) free(strides.ptr);",
                        "\tif ((mp->descr->type_num == at->type_num) && \\",
                        "\t\t\tret = (PyArrayObject *)\\",
                        "\t\t\t\tPyArray_New(arr->ob_type,",
                        "\t\t\tret = arr;",
                        "\t\t\tret = (PyArrayObject *)\\",
                        "\t\t\t\tPyArray_CastToType(arr, typecode);",
                        "\t\t\t\t\t\"Array can not be safely cast \"\\",
                        "        if (PyArray_Check(op)) return op;",
                        "",
                        "        new = PyArray_FromAny(op, NULL, 0, 0, 0);"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/multiarraymodule.c",
                "new_path": "scipy/base/src/multiarraymodule.c",
                "filename": "multiarraymodule.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -2809,13 +2809,26 @@ PyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n \n #define _ARET(x) PyArray_Return((PyArrayObject *)(x))\n \n-static char doc_fromobject[] = \"array(object, dtype=None, copy=1, fortran=0) will return a new array formed from the given object type given.  Object can anything with an __array__ method, or any (nested) sequence.  If no type is given, then the type will be determined as the minimum type required to hold the objects in the  sequence.  If copy is zero and sequence is already an array with the right type, a reference will be returned.  If the sequence is an array, type can be used only to upcast the array.  For downcasting use .astype(t) method.\";\n+static 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 \n static PyObject *\n _array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)\n {\n \tPyObject *op, *ret=NULL;\n-\tstatic char *kwd[]= {\"object\", \"dtype\", \"copy\", \"fortran\", NULL};\n+\tstatic char *kwd[]= {\"object\", \"dtype\", \"copy\", \"fortran\", \"subok\", \n+                             NULL};\n+        Bool subok=FALSE;\n \tBool copy=TRUE;\n \tPyArray_Typecode type = {PyArray_NOTYPE, 0, 0};\n \tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n@@ -2823,16 +2836,18 @@ _array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)\n \tBool fortran=FALSE;\n \tint flags=0;\n \n-\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&\", kwd, &op, \n+\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&O&\", kwd, &op, \n \t\t\t\t\tPyArray_TypecodeConverter,\n                                         &type, \n \t\t\t\t\tPyArray_BoolConverter, &copy, \n-\t\t\t\t\tPyArray_BoolConverter, &fortran)) \n+\t\t\t\t\tPyArray_BoolConverter, &fortran,\n+                                        PyArray_BoolConverter, &subok)) \n \t\treturn NULL;\n \ttype_num = type.type_num;\n \n \t/* fast exit if simple call */\n-\tif (PyArray_Check(op) && (copy==0) &&\t\t\t\\\n+\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\\n+            (copy==0) &&                                             \\\n \t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n \t\tif (type_num == PyArray_NOTYPE) {\n \t\t\tPy_INCREF(op);\n@@ -2851,11 +2866,14 @@ _array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)\n \tif (copy) {\n \t\tflags = ENSURECOPY;\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 _ARET(ret);\n+\treturn ret;\n }\n \n static PyObject *\n",
                "added_lines": 24,
                "deleted_lines": 6,
                "source_code": "\n/*\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 scipy_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 <string.h>\n#include <math.h>\n*/\n\n#define _MULTIARRAYMODULE\n#include \"scipy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL;   /* Must be explicitly loaded */\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\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\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\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\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n        int i;\n        for(i=0;i<n;i++) {\n                if (l1[i] != l2[i]) return 0;\n        } \n        return 1;\n}\n\nstatic PyObject *\nPyArray_View(PyArrayObject *self, PyArray_Typecode *type)\n{\n\tPyObject *new=NULL;\n        PyObject *v=NULL;\n        int type_num = PyArray_NOTYPE;\n\n\tif (type) {\n\t\ttype_num = type->type_num;\n\t}\n\n\tnew = PyArray_New(self->ob_type,\n\t\t\t  self->nd, self->dimensions,\n\t\t\t  self->descr->type_num,\n\t\t\t  self->strides,\n\t\t\t  self->data,\n\t\t\t  self->itemsize,\n\t\t\t  self->flags, (PyObject *)self);\n\n\tif (new==NULL) return NULL;\n\t\n        Py_INCREF(self);\n        PyArray_BASE(new) = (PyObject *)self;\n        if ((type_num != PyArray_NOTYPE) &&             \\\n            (type_num != self->descr->type_num)) {\n                if (!PyTypeNum_ISFLEXIBLE(type_num)) {\n                        v = PyArray_TypeObjectFromType(type_num);\n                }\n                else {\n                        PyArray_Descr *descr;\n                        int itemsize = type->itemsize;\n                        descr = PyArray_DescrFromType(type_num);\n                        if (type_num == PyArray_UNICODE) \n                                itemsize /= sizeof(Py_UNICODE);\n                        /* construct a string representation */\n                        v = PyString_FromFormat(\"%c%d\", descr->type, \n                                                itemsize);\n                }\n                if (v == NULL) goto fail;\n                /* set attribute new.dtype = newtype */\n                if (PyObject_SetAttrString(new, \"dtype\", v) < 0) goto fail;\n                Py_DECREF(v);\n        }\n\treturn new;\t\n\n fail:\n        Py_XDECREF(v);\n        Py_XDECREF(new);\n        return NULL;\n}\n\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n        if (a->nd == 1) {\n                Py_INCREF(a);\n                return (PyObject *)a;\n        }\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) \n\t\treturn PyArray_Newshape(a, &newdim);\n\telse\n\t        return PyArray_Flatten(a, fortran);\n}\n\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tsize = PyArray_SIZE(a);\n\tret = PyArray_New(a->ob_type,\n\t\t\t  1, &size,\n\t\t\t  a->descr->type_num,\n\t\t\t  NULL,\n                          NULL,\n\t\t\t  a->itemsize,\n\t\t\t  0, (PyObject *)a);\n\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\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\n/* Returns a new array \n   with the a new shape from the data\n   in the old array\n*/\n\nstatic PyObject * \nPyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims)\n{\n        intp i, s_original, i_unknown, s_known;\n        intp *dimensions = newdims->ptr;\n        PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n        Bool same;\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<n) {\n                        if (PyArray_DIM(self,i) != dimensions[i]) \n                                same=FALSE;\n                        i++;\n                }\n                if (same) return PyArray_View(self, NULL);\n        }\n\n        if (!PyArray_ISCONTIGUOUS(self)) {\n                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"changing shape only works on contiguous arrays\");\n                return NULL;\n        }\n\t\n        s_known = 1;\n        i_unknown = -1;\n\n        for(i=0; i<n; i++) {\n                if (dimensions[i] < 0) {\n                        if (i_unknown == -1) {\n                                i_unknown = i;\n                        } else {\n                                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"can only specify one \"\t\\\n\t\t\t\t\t\t\" unknown dimension\");\n                                goto fail;\n                        }\n                } else {\n\t\t\ts_known *= dimensions[i];\n                }\n        }\n\t\n        s_original = PyArray_SIZE(self);\n\t\n        if (i_unknown >= 0) {\n                if ((s_known == 0) || (s_original % s_known != 0)) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n                dimensions[i_unknown] = s_original/s_known;\n        } else {\n                if (s_original != s_known) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n        }\n        \n\tret = (PyAO *)PyArray_New(self->ob_type,\n\t\t\t\t  n, dimensions,\n\t\t\t\t  self->descr->type_num,\n\t\t\t\t  NULL,\n\t\t\t\t  self->data,\n\t\t\t\t  self->itemsize,\n\t\t\t\t  self->flags, (PyObject *)self);\n\n\tif (ret== NULL)\n                goto fail;\n\t\n        Py_INCREF(self);\n        ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n        return (PyObject *)ret;\n\t\n fail:\n        return NULL;\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\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; i<nd; i++) {\n\t\tif (self->dimensions[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\tret = PyArray_New(self->ob_type, newnd, dimensions, \n\t\t\t  self->descr->type_num, strides,\n\t\t\t  self->data, self->itemsize, self->flags,\n\t\t\t  (PyObject *)self);\n\tself->flags &= ~OWN_DATA;\n\tself->base = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\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\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype)\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; i<n; i++) {\n\t\tif (i==axis) val = 1;\n\t\telse val = PyArray_DIM(new,i);\n\t\tPyTuple_SET_ITEM(newshape, i, PyInt_FromLong((long)val));\n\t}\n\tobj2 = PyArray_Reshape((PyAO *)obj1, newshape);\n\tPy_DECREF(obj1);\n\tPy_DECREF(newshape);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x = x - mx */\n\tobj1 = PyNumber_Subtract((PyObject *)self, obj2);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x * x */\n\tobj2 = PyNumber_Multiply(obj1, obj1);\n\tPy_DECREF(obj1);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute add.reduce(x*x,axis) */\n\tobj1 = PyArray_GenericReduceFunction((PyArrayObject *)obj2, n_ops.add,\n\t\t\t\t\t     axis, rtype);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\tn = PyArray_DIM(new,axis)-1;\n\tPy_DECREF(new);\n\tif (n==0) n=1;\n\tobj2 = PyFloat_FromDouble(1.0/((double )n));\n\tif (obj2 == NULL) {Py_DECREF(obj1); return NULL;}\n\tret = PyArray_EnsureArray(PyNumber_Multiply(obj1, obj2));\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\n\t/* sqrt() */\n\tobj1 = PyArray_GenericUnaryFunction((PyAO *)ret, n_ops.sqrt);\n\tPy_DECREF(ret);\n\n\treturn obj1;\n}\n\n\nstatic PyObject *\nPyArray_Sum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis, \n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Prod(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.multiply, axis,\n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumSum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumProd(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, \n\t\t\t\t\t\tn_ops.multiply, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Any(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_or, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_All(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_and, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Compress(PyArrayObject *self, PyObject *condition, int axis)\n{\n        PyArrayObject *cond;\n\tPyObject *res, *ret;\n\n        cond = (PyAO *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n        if (cond == NULL) return NULL;\n        \n        if (cond->nd != 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\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; i<size; i++) {\n\t\tif (self->descr->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; i<size; i++) {\n\t\t\tif (self->descr->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; j<n; j++) {\n\t\t\titem = PyArray_New(self->ob_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\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tif (item == NULL) goto fail;\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; i<size; i++) {\n\t\t\tif (self->descr->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; j<n; j++) \n\t\t\t\t\t*(dptr[j])++ = it->coordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n        \n}\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)) goto fail;\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) goto fail;\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(res1);\n\tPy_XDECREF(res2);\n\tPy_XDECREF(two);\n\tPy_XDECREF(selector);\n\treturn NULL;\n}\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_Copy(self);\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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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\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\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyObject *newaxes;\n\tint i, pos;\t\n\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 = PyTuple_New(n);\n\tif (newaxes==NULL) return NULL;\n\t/* insert at the end */\n\tPyTuple_SET_ITEM(newaxes, n-2, PyInt_FromLong((long)axis1));\n\tPyTuple_SET_ITEM(newaxes, n-1, PyInt_FromLong((long)axis2));\n\tpos = 0;\n\tfor (i=0; i<n; i++) {\n\t\tif ((i==axis1) || (i==axis2)) continue;\n\t\tPyTuple_SET_ITEM(newaxes, pos++, \n\t\t\t\t PyInt_FromLong((long) i));\n\t}\n\tnew = PyArray_Transpose(self, newaxes);\n\tPy_DECREF(newaxes);\n\tif (new == NULL) return NULL;\n\tself = (PyAO *)new;\n\t\n\tif (n == 2) {\n\t\tPyObject *a=NULL, *indices=NULL, *ret=NULL;\n\t\tintp n1, n2, start, stop, step, count;\n\t\tintp *dptr;\n\t\tn1 = self->dimensions[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; n1<stop; n1+=step) *dptr++ = n1;\n\t\ta = PyArray_IterNew((PyObject *)self);\n\t\tPy_DECREF(self);\n\t\tif (a == NULL) {Py_DECREF(indices); return NULL;}\n\t\tret = PyObject_GetItem(a, indices);\n\t\tPy_DECREF(a);\n\t\tPy_DECREF(indices);\n\t\treturn ret;\n\t}\t\n\n\telse {\n\t\t/* \n\t\t   my_diagonal = []\n\t\t   for i in range (s [0]) :\n\t\t       my_diagonal.append (diagonal (a [i], offset))\n\t\t   return array (my_diagonal)\t\n\t\t*/\t\n\t\tPyObject *mydiagonal=NULL, *new=NULL, *ret=NULL, *sel=NULL;\n\t\tintp i, n1;\n\t\tint res;\n\t\tPyArray_Typecode typecode;\n\n\t\ttypecode.type_num = self->descr->type_num;\n\t\ttypecode.itemsize = self->itemsize;\n\t\ttypecode.fortran = 0;\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<n1; i++) {\n\t\t\tnew = PyInt_FromLong((long) i);\n\t\t\tsel = PyArray_EnsureArray(PyObject_GetItem((PyObject *)self, new));\n\t\t\tPy_DECREF(new);\n\t\t\tif (sel == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnew = PyArray_Diagonal((PyAO *)sel, offset, n-3, n-2);\n\t\t\tPy_DECREF(sel);\n\t\t\tif (new == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tres = PyList_Append(mydiagonal, new);\n\t\t\tPy_DECREF(new);\n\t\t\tif (res < 0) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(self);\n\t\tret =  PyArray_FromAny(mydiagonal, &typecode, 0, 0, 0);\n\t\tPy_DECREF(mydiagonal);\n\t\treturn ret;\n\t}\n}\n\n\n\n\n\n\n/* simulates a C-style 1-3 dimensional array which can be accesed using \n    ptr[i]  or ptr[i][j] or ptr[i][j][k] -- requires pointer allocation \n    for 2-d and 3-d.\n\n    Especially for 2-d and up, ptr is NOT equivalent to a statically defined\n    2-d or 3-d array.  In particular, it cannot be passed into a \n    function that requires a true pointer to a fixed-size array. \n*/\n\nstatic int\nPyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, int type_num) \n{\n\tPyArrayObject *ap;\n\tPyArray_Typecode typecode = {0, 0, 0};\n\tintp n, m, i, j;\n\tchar **ptr2;\n\tchar ***ptr3;\n\n\ttypecode.type_num = type_num;\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot treat flexible type as C array.\");\n\t\treturn -1;\n\t}\n\tif ((nd < 1) || (nd > 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"Only Carrays of 1-3 dimensions available.\");\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, &typecode, 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 **)malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr2[i] = ap->data + 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 ***)malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr3[i] = ptr3[n + (m-1)*i];\n\t\t\tfor (j=0; j<m; j++) {\n\t\t\t\tptr3[i][j] = ap->data + 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\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, typecode) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, typecode) == -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\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\tfree(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<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\tarr = PyArray_FROM_O(otmp);\n\t\tPy_DECREF(otmp);\n\t\tif (arr==NULL) goto fail;\n\t\totmp = PyArray_SwapAxes((PyArrayObject *)arr, axis, 0);\n\t\tPy_DECREF(arr);\n\t\tif (otmp == NULL) goto fail;\n\t\tPyTuple_SET_ITEM(newtup, i, otmp);\n\t}\n\totmp = PyArray_Concatenate(newtup, 0);\n\tPy_DECREF(newtup);\n\tif (otmp == NULL) return NULL;\n\tarr = PyArray_SwapAxes((PyArrayObject *)otmp, axis, 0);\n\tPy_DECREF(otmp);\n\treturn arr;\n\t\n fail:\n\tPy_DECREF(newtup);\n\treturn NULL;\n}\n\n/*op is a python object supporting the sequence interface.\n  Its elements will be concatenated together to form a single \n  multidimensional array.*/\n/* If axis is MAX_DIMS or bigger, then each sequence object will \n   be flattened before concatenation \n*/\nstatic PyObject *\nPyArray_Concatenate(PyObject *op, int axis) \n{\n\tPyArrayObject *ret, **mps;\n\tPyObject *otmp;\n\tint i, n, type_num, tmp, nd=0, new_dim;\n\tchar *data;\t\n\tPyTypeObject *subtype;\n\tdouble prior1, prior2;\n\tintp numbytes;\n\n\tn = PySequence_Length(op);\n\tif (n == -1) {\n\t\treturn NULL;\n\t}\n\tif (n == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Concatenation of zero-length sequences is \"\\\n\t\t\t\t\"impossible.\");\n\t\treturn NULL;\n\t}\n\n\tif ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS)))\n\t\treturn _swap_and_concat(op, axis, n);\n\t\n\tret = NULL;\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\t/* Make sure these arrays are legal to concatenate. */\n\t/* Must have same dimensions except d0, and have coercible type. */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays \"\\\n\t\t\t\t\"to concatenate\");\n\t\tgoto fail;\n\t}\n\n\tprior1 = 0.0;\n\tsubtype = &PyArray_Type;\n\tret = NULL;\n\tfor(i=0; i<n; i++) {\n\t\tPyArray_Typecode typecode = {0, 0, 0};\n\t\ttypecode.type_num = type_num;\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) goto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_FromAny(otmp, &typecode, 0, 0, CARRAY_FLAGS);\n\t\tPy_DECREF(otmp);\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (axis >= 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; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (i == 0) nd = mps[i]->nd;\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\"0d 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\tret = (PyArrayObject *)PyArray_New(subtype, nd,\n\t\t\t\t\t   mps[0]->dimensions, \n\t\t\t\t\t   type_num, NULL, NULL, 0, 0,\n                                           (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; i<n; i++) {\n\t\tnumbytes = PyArray_NBYTES(mps[i]);\n\t\tmemcpy(data, mps[i]->data, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)\n{\n\tPyObject *new_axes;\n\tint n, i, val;\n\tPyObject *ret;\n\n\tif (a1 == a2) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\t\n\tn = ap->nd;\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 = PyTuple_New(n);\n\tfor (i=0; i<n; i++) {\n\t\tif (i == a1) val = a2;\n\t\telse if (i == a2) val = a1;\n\t\telse val = i;\n\t\tPyTuple_SET_ITEM(new_axes, i, PyInt_FromLong((long) val));\n\t}\n\tret = PyArray_Transpose(ap, new_axes);\n\tPy_DECREF(new_axes);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Transpose(PyArrayObject *ap, PyObject *op) {\n\tintp *axes, axis;\n\tintp i, n;\n\tintp *permutation = NULL;\n\tPyArrayObject *ret = NULL;\n\t\n\tif (op == Py_None || op == NULL) {\n\t\tn = ap->nd;\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\tfor(i=0; i<n; i++)\n\t\t\tpermutation[i] = n-1-i;\n\t} else {\n\t\tif (PyArray_AsCArray(&op, (char **)&axes, &n, 1,\n\t\t\t\t PyArray_INTP) == -1)\n\t\t\treturn NULL;\n\t\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\n\t\tfor(i=0; i<n; i++) {\n\t\t\taxis = axes[i];\n\t\t\tif (axis < 0) axis = ap->nd+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\tgoto fail;\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\tret = (PyArrayObject *)PyArray_New(ap->ob_type, n, permutation, \n\t\t\t\t\t   ap->descr->type_num, NULL,\n\t\t\t\t\t   ap->data, ap->itemsize, ap->flags,\n\t\t\t\t\t   (PyObject *)ap);\n\tif (ret == NULL) goto fail;\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; i<n; i++) {\n\t\tret->dimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n\tif (op && (op != Py_None))\n\t\tPyArray_Free(op, (char *)axes);\n\tfree(permutation);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tif (permutation != NULL) free(permutation);\n\tif (op != Py_None)\n\t\tPyArray_Free(op, (char *)axes);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\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_ContiguousFromObject(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; j<n; j++) {\n\t\t\tif (counts[j] < 0) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \"count < 0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\ttotal += counts[j];\n\t\t}\n\t}\n\n\n\t/* Construct new array */\n\taop->dimensions[axis] = total;\n\tret = (PyArrayObject *)PyArray_New(aop->ob_type, aop->nd,\n\t\t\t\t\t   aop->dimensions, \n\t\t\t\t\t   aop->descr->type_num,\n\t\t\t\t\t   NULL, NULL, aop->itemsize, 0,\n\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->itemsize;\n\tfor(i=axis+1; i<aop->nd; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; i<axis; i++) n_outer *= aop->dimensions[i];\n\n\tfor(i=0; i<n_outer; i++) {\n\t\tfor(j=0; j<n; j++) {\n\t\t\ttmp = (nd ? counts[j] : counts[0]);\n\t\t\tfor(k=0; k<tmp; k++) {\n\t\t\t\tmemcpy(new_data, old_data, chunk);\n\t\t\t\tnew_data += chunk;\n\t\t\t}\n\t\t\told_data += chunk;\n\t\t}\n\t}\n\n\tPy_DECREF(repeats);\n\tPyArray_INCREF(ret);\n\tPy_XDECREF(aop);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_DECREF(repeats);\n\tPy_XDECREF(aop);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\nstatic PyObject *\nPyArray_Choose(PyArrayObject *ip, PyObject *op) {\n\tintp i, n, *sizes, m, offset, elsize, type_num;\n\tchar *ret_data;\n\tPyArrayObject **mps, *ap, *ret;\n\tPyObject *otmp;\n\tintp *self_data, mi;\n\tap = NULL;\n\tret = NULL;\n\t\n\tn = PySequence_Length(op);\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\tsizes = (intp *)malloc(n*sizeof(intp));\n\t\n\t/* Figure out the right type for the new array */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays to \"\\\n\t\t\t\t\"choose from\");\n\t\tgoto fail;\n\t}\n\t\n\t/* Make sure all arrays are actual array objects. */\n\tfor(i=0; i<n; i++) {\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n\t\t\tgoto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_ContiguousFromObject(otmp, type_num, \n\t\t\t\t\t\t     0, 0);\n\t\tPy_DECREF(otmp);\n\t}\n\t\n\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)ip, \n\t\t\t\t\t\t\t   PyArray_INTP, \n\t\t\t\t\t\t\t   0, 0);\n\tif (ap == NULL) goto fail;\n\t\n\t/* Check the dimensions of the arrays */\n\tfor(i=0; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (ap->nd < 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\t/* why not ??? \n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Not implemented for flexible sizes\");\n\t\treturn NULL;\n\t}\n\t*/\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->itemsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i<m; i++) {\n\t\tmi = *self_data;\n\t\tif (mi < 0 || mi >= 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; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_DECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\n\treturn (PyObject *)ret;\n\t\n fail:\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_XDECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\tPy_XDECREF(ret);\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->compare(a,b,global_obj);\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#define SWAPBACK(op, ap) { \\\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\nstatic PyObject *\nPyArray_Sort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tif ((ap = (PyAO*) _check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_CopyFromObject((PyObject *)op, \n\t\t\t\t\t\t     PyArray_NOTYPE,\n\t\t\t\t\t\t     1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\n\tif (ap->descr->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\n\t}\n\t\n\telsize = ap->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\tqsort(ip, m, elsize, qsortCompare);\n\t}\n\t\n\tglobal_obj = store_arr;\n\t\t\n\tif (PyErr_Occurred()) {\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\t\n\t}\n\n finish:\n\tSWAPBACK(op, ap);\n\n\treturn (PyObject *)op;\n}\n\n\nstatic char *global_data;\n\nstatic int \nargsort_static_compare(const void *ip1, const void *ip2) \n{\n\tint isize = global_obj->itemsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->compare(global_data + (isize * *ipa),\n                                          global_data + (isize * *ipb), \n\t\t\t\t\t  global_obj);\n}\n\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap, *ret, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tif ((ap = (PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op, \n\t\t\t\t\t\t\t   PyArray_NOTYPE,\n\t\t\t\t\t\t\t   1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, PyArray_INTP,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\tif (ap->descr->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\tip = (intp *)ret->data;\n\targsort_elsize = ap->itemsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\tstore_ptr = global_data;\n\tglobal_data = ap->data;\n\tstore = global_obj;\n\tglobal_obj = ap;\n\tfor (i=0; i<n; i++, ip+=m, global_data += m*argsort_elsize) {\n\t\tfor(j=0; j<m; j++) ip[j] = j;\n\t\tqsort((char *)ip, m, sizeof(intp),\n\t\t      argsort_static_compare);\n\t}\n\tglobal_data = store_ptr;\n\tglobal_obj = store;\n\n\n finish:\n\tPy_DECREF(ap);\n\tSWAPBACK(op, ret);\n\treturn (PyObject *)op;\n\n fail:\n\tPy_XDECREF(ap);\n\tPy_XDECREF(ret);\n\treturn NULL;\n\n}  \n\nstatic void \nlocal_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret)\n{\t\n\tPyArray_CompareFunc *compare = ap2->descr->compare;\n\tintp  min_i, max_i, i, j;\n\tint location, elsize = ap1->itemsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_Size((PyObject *)ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j<n; j++, ip+=elsize, rp++) {\n\t\tmin_i = 0;\n\t\tmax_i = elements;\n\t\twhile (min_i != max_i) {\n\t\t\ti = (max_i-min_i)/2 + min_i;\n\t\t\tlocation = compare(ip, vp+elsize*i, ap2);\n\t\t\tif (location == 0) {\n\t\t\t\twhile (i > 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\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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_ContiguousFromObject((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_ContiguousFromObject(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->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\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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->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->itemsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2*l;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1*l;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\t\t\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/* just like inner product but does the swapaxes stuff on the fly */\nstatic PyObject *\nPyArray_MatrixProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tintp matchDim, otherDim, is2r, is1r;\n\tPyTypeObject *subtype;\n        double prior1, prior2;\n        \n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\t\n\t\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(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\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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<j; i++) \n\t   fprintf(stderr, \"%d \", dimensions[i]);\n\t   fprintf(stderr, \"\\n\"); \n\t*/\n\n        /* Choose which subtype to return */\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->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->itemsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2r;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1r;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\n\t\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\nstatic PyObject *\nPyArray_CopyAndTranspose(PyObject *op) \n{\n\tPyObject *ret, *arr;\n\tint nd;\n\tintp dims[2];\n\tintp i,j;\n\tint elsize, str2;\n\tchar *iptr;\n\tchar *optr;\n\n\t/* make sure it is well-behaved */\n\tarr = PyArray_FromAny(op, NULL, 0, 0, CARRAY_FLAGS);\n\tnd = PyArray_NDIM(arr);\n\tif (nd == 1) {     /* we will give in to old behavior */\n\t\tret = PyArray_Copy((PyArrayObject *)arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\t\t\n\t}\n\telse if (nd != 2) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Only 2-d arrays are allowed.\");\n\t\treturn NULL;\n\t}\n\n\t/* Now construct output array */\n\tdims[0] = PyArray_DIM(arr,1);\n\tdims[1] = PyArray_DIM(arr,0);\n\telsize = PyArray_ITEMSIZE(arr);\n\n\tret = PyArray_New(arr->ob_type, 2, dims, PyArray_TYPE(arr),\n\t\t\t  NULL, NULL, elsize, 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; i<dims[0]; i++) {\n\t\tiptr = PyArray_DATA(arr) + i*elsize;\n\t\tfor (j=0; j<dims[1]; j++) {\n\t\t\t/* optr[i,j] = iptr[j,i] */\n\t\t\tmemcpy(optr, iptr, elsize);\n\t\t\toptr += elsize;\n\t\t\tiptr += str2;\n\t\t}\n\t}\n\tPy_DECREF(arr);\n\treturn ret;\n}\n \nstatic PyObject *\nPyArray_Correlate(PyObject *op1, PyObject *op2, int mode) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\n\tintp length;\n\tint i, n1, n2, n, n_left, n_right;\n\tint typenum;\n\tint is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tPyArray_DotFunc *dot;\n\t\n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\t\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    1, 1);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum, \n\t\t\t\t\t\t\t    1, 1);\n\tif (ap2 == NULL) goto fail;\n\t\n\tn1 = ap1->dimensions[ap1->nd-1];\n\tn2 = ap2->dimensions[ap2->nd-1];\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 = (int)(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\t\n\tret = (PyArrayObject *)PyArray_New(ap1->ob_type, 1,\n\t\t\t\t\t   &length, typenum, \n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)ap1);\n\tif (ret == NULL) goto fail;\n\n\t\n\tdot = ret->descr->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->itemsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; i<n_left; i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tn++;\n\t\tip2 -= is2;\n\t\top += os;\n\t}\n\tfor(i=0; i<(n1-n2+1); i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tfor(i=0; i<n_right; i++) {\n\t\tn--;\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tif (PyErr_Occurred()) goto fail;\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\nstatic PyObject *\nPyArray_ArgMin(PyArrayObject *ap, int axis) \n{\n\tPyObject *obj, *new, *ret;\n\n\tif (PyArray_ISFLEXIBLE(ap)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"argmax is unsupported for this type.\");\n\t\treturn NULL;\n\t}\n\telse if (PyArray_ISUNSIGNED(ap)) \n\t\tobj = PyInt_FromLong((long) -1);\n\t\n\telse if (PyArray_TYPE(ap)==PyArray_BOOL) \n\t\tobj = PyInt_FromLong((long) 1);\n\t\n\telse \n\t\tobj = PyInt_FromLong((long) 0);\n\t\n\tnew = PyNumber_Subtract(obj, (PyObject *)ap);\n\tif (new == NULL) return NULL;\n\n\tPy_DECREF(obj);\n\tret = PyArray_ArgMax((PyArrayObject *)new, axis);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Max(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.maximum, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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\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_ContiguousFromObject((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->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->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\targ_func(ip, m, rptr, ap);\n\t\trptr += 1;\n\t}\n\tPy_DECREF(ap);\n\n\tSWAPBACK(op, rp);     /* op now contains the return */\n  \n\treturn (PyObject *)op;\n\t\n fail:\n\tPy_DECREF(ap);\n\tPy_XDECREF(rp);\n\treturn NULL;\n}  \n\n\nstatic PyObject *\nPyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n        PyArrayObject *self, *indices, *ret;\n        intp nd, i, j, n, m, max_item, tmp, chunk;\n\tintp shape[MAX_DIMS];\n        char *src, *dest;\n\t\n        indices = ret = NULL;\n\tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n        if (self == NULL) return NULL;\n\t\n        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, \n\t\t\t\t\t\t\t\tPyArray_INTP, \n\t\t\t\t\t\t\t\t1, 0);\n        if (indices == NULL) goto fail;\n\t\n        n = m = chunk = 1;\n        nd = self->nd + 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        ret = (PyArrayObject *)PyArray_New(self->ob_type, nd, shape, \n\t\t\t\t\t   self->descr->type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)self);\n\t\n        if (ret == NULL) goto fail;\n\t\n        max_item = self->dimensions[axis];\n        chunk = chunk * ret->itemsize;\n        src = self->data;\n        dest = ret->data;\n\t\n        for(i=0; i<n; i++) {\n                for(j=0; j<m; j++) {\n                        tmp = ((intp *)(indices->data))[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\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0) \n{\n        PyArrayObject  *indices, *values;\n        int i, chunk, ni, max_item, nv, tmp; \n        char *src, *dest;\n\n        indices = NULL;\n        values = NULL;\n\n        if (!PyArray_Check(self)) {\n                PyErr_SetString(PyExc_ValueError, \"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->itemsize;\n\n        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, PyArray_INTP, 0, 0);\n        if (indices == NULL) goto fail;\n        ni = PyArray_SIZE(indices);\n\n        values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromObject(values0, self->descr->type_num, \n\t\t\t\t\t     0, 0);\n        if (values == NULL) goto fail;\n        nv = PyArray_SIZE(values);\n        if (nv > 0) { /* nv == 0 for a null array */\n                for(i=0; i<ni; i++) {\n                        src = values->data + 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        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\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0) \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_ValueError, \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->itemsize;\n\n        mask = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromObject(mask0, PyArray_BOOL, 0, 0);\n        if (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_ContiguousFromObject(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\t\tfor(i=0; i<ni; i++) {\n\t\t\tsrc = values->data + chunk * (i % nv);\n\t\t\ttmp = ((Bool *)(mask->data))[i];\n\t\t\tif (tmp) {\n\t\t\t\tmemmove(dest + i * chunk, src, chunk);\n\t\t\t\tif (thistype == PyArray_OBJECT)\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\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    \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\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{\n\tif (PyObject_IsTrue(object)) *val=TRUE;\n\telse *val=FALSE;\n\tif (PyErr_Occurred()) return PY_FAIL;\n\treturn PY_SUCCEED;\n}\n\n\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (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\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n        int buflen;\n\n        buf->ptr = NULL;\n        buf->flags = WRITEABLE;\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\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) goto fail;\n        return PY_SUCCEED;\n\n fail:\n\tPyDimMem_FREE(seq->ptr);\n\treturn PY_FAIL;\n}\n\n/* This function takes a Python object representing a type and converts it \n   to a C type_num and an itemsize (elements of PyArray_Typecode structure)\n   \n   Many objects can be used to represent a type.\n */\n\nstatic int\nPyArray_TypecodeConverter(PyObject *obj, PyArray_Typecode *at)\n{\n        char *type;\n        PyArray_Descr *descr;\n        int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item, *attr=NULL;\n\n\tat->itemsize = 0;\n        if (obj == Py_None) {\n                at->type_num = PyArray_NOTYPE;\n                return PY_SUCCEED;\n        }\n\n        if (PyType_Check(obj) && PyType_IsSubtype((PyTypeObject *)obj, \n                                                  &PyGenericArrType_Type)) {\n                PyArray_TypecodeFromTypeObject(obj, at);\n                return PY_SUCCEED;\n        }\n\n\n\t/* type object could be an array */\n\tif (PyArray_Check(obj)) {\n\t\tat->type_num = PyArray_TYPE(obj);\n\t\tat->itemsize = PyArray_ITEMSIZE(obj);\n\t\treturn PY_SUCCEED;\n\t}\n\n\t/* or an array scalar */\n        if (PyArray_IsScalar(obj, Generic)) {\n                PyArray_TypecodeFromScalar(obj, at);\n                return PY_SUCCEED;\n        }\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);\t\t\n\t\tif (len > 0) {\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tif (len > 1) {\n\t\t\tat->itemsize = atoi(type+1);\n\t\t\t/* When specifying length of UNICODE\n\t\t\t   the number of characters is given to match \n\t\t\t   the STRING interface.  Each character can be\n\t\t\t   more than one byte and itemsize must be\n\t\t\t   the number of bytes.\n\t\t\t*/\n\t\t\tif (check_num == PyArray_UNICODELTR ||\t\\\n\t\t\t    check_num == PyArray_UNICODE) \n\t\t\t  at->itemsize *= sizeof(Py_UNICODE);\n\n\t\t\t/* Support for generic processing */\n\t\t\telse if ((check_num != PyArray_STRINGLTR) &&\n\t\t\t\t (check_num != PyArray_VOIDLTR) &&\n\t\t\t\t (check_num != PyArray_STRING) &&\n\t\t\t\t (check_num != PyArray_VOID)) {\n\t\t\t\tcheck_num = \\\n\t\t\t\t\tPyArray_TypestrConvert(at->itemsize,\n\t\t\t\t\t\t\t       check_num);\n\t\t\t        at->itemsize = 0;\n\t\t\t\tif (check_num == PyArray_NOTYPE) goto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Arbitray object with dtypenum and itemsize attributes. */\n\telse if (PyObject_HasAttrString(obj, \"dtypenum\") && \n\t    PyObject_HasAttrString(obj, \"itemsize\")) {\n\t\tattr = PyObject_GetAttrString(obj, \"dtypenum\");\n\t\tcheck_num = PyInt_AsLong(attr);\n\t\tif (PyErr_Occurred()) {  /* not an integer, try character */\n\t\t\tPyErr_Clear();\n\t\t\ttype = PyString_AsString(attr);\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tif (!PyErr_Occurred()) {\n\t\t\tattr = PyObject_GetAttrString(obj, \"itemsize\");\n\t\t\tat->itemsize = PyInt_AsLong(attr);\n\t\t\tPy_XDECREF(attr);\n\t\t}\t\t\t\n\t}\t\t\n\telse if (PyType_Check(obj)) {\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 *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\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                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}\t\n        else { /* Default -- try integer conversion */\n                check_num = PyInt_AsLong(obj);\n\t}\n\n\tif (PyErr_Occurred()) goto fail;\n\n\t/*\n\tif (check_num == PyArray_NOTYPE) return PY_FAIL;\n\t*/\n\tif (check_num == PyArray_NOTYPE) {\n\t\tat->type_num = PyArray_NOTYPE;\n\t\tat->itemsize = 0;\n\t\treturn PY_SUCCEED;\n\t}\n\n        if ((descr = PyArray_DescrFromType(check_num))==NULL) {\n\t\t/* Now check to see if the object is registered\n\t\t   in typeDict */\n\t\tif (typeDict != NULL) {\n\t\t\titem = PyDict_GetItem(typeDict, obj);\n\t\t\tif (item) {\n\t\t\t\tPyArray_TypecodeFromTypeObject(obj, at);\n\t\t\t\tPyErr_Clear();\n\t\t\t\treturn PY_SUCCEED;\n\t\t\t}\n\t\t}\n                return PY_FAIL;\n\t}\n\t\n        at->type_num = descr->type_num;\n\tif (at->itemsize == 0) at->itemsize = descr->elsize;\n\t\n        return PY_SUCCEED;\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\treturn PY_FAIL;\n}\t\n\n\n/* This function returns true if the two typecodes are \n   equivalent (same basic kind and same itemsize).\n*/\n\nstatic Bool\nPyArray_EquivalentTypes(PyArray_Typecode *typ1, PyArray_Typecode *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->itemsize;\n\tregister int size2=typ2->itemsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typenum1==typenum2) return TRUE;\n\n\t/* If we are here then size1 == size2 */\n\tif (typenum1 < PyArray_FLOAT) {\n\t\tif (PyTypeNum_ISBOOL(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISBOOL(typenum2));\n\t\telse if (PyTypeNum_ISUNSIGNED(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISUNSIGNED(typenum2));\n\t\telse \n\t\t\treturn (Bool)(PyTypeNum_ISSIGNED(typenum2));\n\t}\n\telse {\n\t\tif (PyTypeNum_ISFLOAT(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISFLOAT(typenum2));\n\t\telse if (PyTypeNum_ISCOMPLEX(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISCOMPLEX(typenum2));\n\t}\n\t/* Default size1 != size2 and typenum1 != typenum2 */\n\treturn FALSE;\t\n}\n\nstatic Bool \nPyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n{\n        PyArray_Typecode type1={0,0,0};\n        PyArray_Typecode type2={0,0,0};\n\n\ttype1.type_num = PyArray_TYPE(a1);\n\ttype2.type_num = PyArray_TYPE(a2);\n\ttype1.itemsize = PyArray_ITEMSIZE(a1);\n\ttype2.itemsize = PyArray_ITEMSIZE(a2);\n\t\t\t\n        return PyArray_EquivalentTypes(&type1, &type2);\n}\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_Typecode type = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n\tint type_num;\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_TypecodeConverter,\n                                        &type, \n\t\t\t\t\tPyArray_BoolConverter, &copy, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n                                        PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\ttype_num = type.type_num;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\\n            (copy==0) &&                                             \\\n\t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n\t\tif (type_num == PyArray_NOTYPE) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t\t/* One more chance */\n\t\toldtype.type_num = PyArray_TYPE(op);\n\t\toldtype.itemsize = PyArray_ITEMSIZE(op);\n\t\tif (PyArray_EquivalentTypes(&oldtype, &type)) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t}\n\n\ttype.fortran = fortran; \n\tif (copy) {\n\t\tflags = ENSURECOPY;\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\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n        \n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Empty(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypestr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. typestr must be a valid data typestr (complete with < > or |).  If dtypestr is object, 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[] = {\"dtypestr\",\"obj\", NULL};\n\tPyArray_Typecode typecode;\n\tPyObject *obj=NULL;\n\tchar *typestr;\n\tint typestrlen;\n\tint swap, alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"z#|O\",\n\t\t\t\t\t kwlist, &typestr, &typestrlen,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\n\tif (_array_typecode_fromstr(typestr, &swap, &typecode) < 0) \n\t\treturn NULL;\n\t\n\tif (typecode.itemsize == 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\tswap = 0;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = malloc(typecode.itemsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode.itemsize);\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_ValueError, \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.itemsize) {\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.type_num,\n\t\t\t     typecode.itemsize, swap); \n\n\t/* free dptr which contains zeros */\n\tif (alloc) free(dptr);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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 {\t\t\n\t\tmemset(ret->data, 0, n*(ret->itemsize));\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Zeros(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return 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\nstatic char doc_fromString[] = \"fromstring(string, dtype=intp, count=-1, swap=False) 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\tPyArrayObject *ret; \n\tchar *data;\n\tlonglong nin=-1;\n\tintp s, n;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", \"swap\",NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint itemsize;\n\tint swapped=FALSE;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&LO&\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &swapped)) {\n\t\treturn NULL;\n\t}\n\t\n\tn = (intp) nin;\n\n\titemsize = type.itemsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize.\");\n\t\treturn NULL;\n\t}\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\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\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\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype.type_num, NULL, \n\t\t\t\t\t\tNULL, itemsize, 0,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*ret->itemsize);\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPyArray_INCREF(ret);\n\treturn (PyObject *)ret;\n}\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\nstatic int\n_fill_in_itemsize(PyArray_Typecode *typecode)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(typecode->type_num);\n\tif (descr==NULL) return -1;\n\ttypecode->itemsize = descr->elsize;\n\treturn 0;\n}\n\n\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Typecode *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\n\tif (typecode->itemsize == 0) {\n\t\tif (_fill_in_itemsize(typecode) < 0) \n\t\t\treturn NULL;\n\t}\n\n\tif (num == -1 && sep == NULL) {  /* 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\tfseek(fp, (long) start, SEEK_SET);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \"Could not seek in file.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif (typecode->itemsize == 0) {\n\t\t\ttypecode->itemsize = numbytes;\n\t\t\tnum = 1;\n\t\t}\n\t\telse {\n\t\t\tnum = numbytes / typecode->itemsize;\n\t\t}\n\t}\n\t\n\tif (sep==NULL) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &num, \n\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t typecode->itemsize, 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->itemsize, 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 = PyArray_DescrFromType(typecode->type_num)->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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &num, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\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, r->itemsize, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->itemsize;\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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &size, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->itemsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, r->itemsize, 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->itemsize;\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->itemsize);\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->itemsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=intp, count=-1, sep='')\\n\"\\\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_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\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, \"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\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Typecode *type, \n\t\t   intp count, int swapped) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\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\treturn NULL;\n\t}\n\tif (type->itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Itemsize cannot be zero in type\");\n\t\treturn NULL;\n\t}\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\treturn NULL;\n\t\t}\n\t}\n\ts = (intp)ts;\t\n\tn = (intp)count;\n\titemsize = type->itemsize;\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\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\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype->type_num, NULL, \n\t\t\t\t\t\tdata, itemsize, DEFAULT_FLAGS,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPy_INCREF(buf);\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret; \t\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=intp, count=-1, swap=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 the buffer has data that is out\\n\" \\\n\t\"   not in machine byte-order, than set swap=1.  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;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", \n\t\t\t\t \"swap\", NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint swapped=0;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Li\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &swapped)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromBuffer(obj, &type, (intp)nin, swapped);\n}\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\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length, i;\n\tPyObject *range;\n\tchar *rptr;\n\tint elsize, type;\n\tdouble value;\n\tPyArray_Descr *dbl_descr;\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\tdbl_descr = PyArray_DescrFromType(PyArray_DOUBLE);\n    \n\trptr = ((PyArrayObject *)range)->data;\n\telsize = ((PyArrayObject *)range)->itemsize;\n\ttype = ((PyArrayObject *)range)->descr->type_num;\n\tfor (i=0; i < length; i++) {\n\t\tvalue = start + i*step;\n\t\tdbl_descr->cast[type]((char*)&value, rptr, 1, NULL, \n\t\t\t\t      (PyArrayObject *)range);\n\t\trptr += elsize;\n\t}\n    \n\treturn range;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=intp)\\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=Py_None, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tdouble start, stop, step;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0};\n\tint type_num;\n\tint deftype = PyArray_INTP;\n\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_TypecodeConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\tdeftype = PyArray_ObjectType(o_start, deftype);\n\tif (o_stop != Py_None) {\n\t\tdeftype = PyArray_ObjectType(o_stop, deftype);\n\t}\n\tif (o_step != NULL) {\n\t\tdeftype = PyArray_ObjectType(o_step, deftype);\n\t}\n\n\ttype_num = typecode.type_num;\n\tif (type_num == PyArray_NOTYPE) {\n\t\ttype_num = deftype;\n\t}\n\n\tstart = PyFloat_AsDouble(o_start);\n\tif error_converting(start) return NULL;\n\n\tif (o_step == NULL) {\n\t\tstep = 1;\n\t}\n\telse {\n\t\tstep = PyFloat_AsDouble(o_step);\n\t\tif error_converting(step) return NULL;\n\t}\n\n\tif (o_stop == Py_None) {\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\telse {\n\t\tstop = PyFloat_AsDouble(o_stop);\n\t\tif error_converting(stop) return NULL;\n\t}\n\n\treturn PyArray_Arange(start, stop, step, type_num);\n}\n\n#undef _ARET\n\n/*****\n      static char doc_arrayMap[] = \"arrayMap(func, [a1,...,an])\";\n\n      static PyObject *array_arrayMap(PyObject *dummy, PyObject *args) {\n      PyObject *shape, *a0;\n  \n      if (PyArg_ParseTuple(args, \"OO\", &a0, &shape) == NULL) return NULL;\n\t\n      return PyArray_Map(a0, shape);\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\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 (PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"One or more objects is not callable.\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\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\tif ((x==NULL) || (y==NULL)) {\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\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\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, n_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_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_Typecode d1={PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode d2={PyArray_NOTYPE, 0, 0};\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_TypecodeConverter, &d1,\n\t\t\t\t\tPyArray_TypecodeConverter, &d2))\n\t\treturn NULL;\n\tif (d1.type_num == PyArray_NOTYPE || \\\n\t    d2.type_num == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types. \"\\\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 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{\"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/*  {\"arrayMap\",\t(PyCFunction)array_arrayMap, \n\t    METH_VARARGS, doc_arrayMap},*/\n\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_Tyupe\",  \\\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(Numeric, Generic);\n        SINGLE_INHERIT(Integer, Numeric);\n        SINGLE_INHERIT(Inexact, Numeric);\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        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        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        SINGLE_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\t   \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, \"NOTSWAPPED\", s=PyInt_FromLong(NOTSWAPPED));\n        Py_DECREF(s);\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\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n                return; \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(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\n        set_flaginfo(d);\n\n\tif (set_typeinfo(d) == 0) \n                return;  /* otherwise there is an error */\n\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/*\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 scipy_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 <string.h>\n#include <math.h>\n*/\n\n#define _MULTIARRAYMODULE\n#include \"scipy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL;   /* Must be explicitly loaded */\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\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\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\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\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n        int i;\n        for(i=0;i<n;i++) {\n                if (l1[i] != l2[i]) return 0;\n        } \n        return 1;\n}\n\nstatic PyObject *\nPyArray_View(PyArrayObject *self, PyArray_Typecode *type)\n{\n\tPyObject *new=NULL;\n        PyObject *v=NULL;\n        int type_num = PyArray_NOTYPE;\n\n\tif (type) {\n\t\ttype_num = type->type_num;\n\t}\n\n\tnew = PyArray_New(self->ob_type,\n\t\t\t  self->nd, self->dimensions,\n\t\t\t  self->descr->type_num,\n\t\t\t  self->strides,\n\t\t\t  self->data,\n\t\t\t  self->itemsize,\n\t\t\t  self->flags, (PyObject *)self);\n\n\tif (new==NULL) return NULL;\n\t\n        Py_INCREF(self);\n        PyArray_BASE(new) = (PyObject *)self;\n        if ((type_num != PyArray_NOTYPE) &&             \\\n            (type_num != self->descr->type_num)) {\n                if (!PyTypeNum_ISFLEXIBLE(type_num)) {\n                        v = PyArray_TypeObjectFromType(type_num);\n                }\n                else {\n                        PyArray_Descr *descr;\n                        int itemsize = type->itemsize;\n                        descr = PyArray_DescrFromType(type_num);\n                        if (type_num == PyArray_UNICODE) \n                                itemsize /= sizeof(Py_UNICODE);\n                        /* construct a string representation */\n                        v = PyString_FromFormat(\"%c%d\", descr->type, \n                                                itemsize);\n                }\n                if (v == NULL) goto fail;\n                /* set attribute new.dtype = newtype */\n                if (PyObject_SetAttrString(new, \"dtype\", v) < 0) goto fail;\n                Py_DECREF(v);\n        }\n\treturn new;\t\n\n fail:\n        Py_XDECREF(v);\n        Py_XDECREF(new);\n        return NULL;\n}\n\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n        if (a->nd == 1) {\n                Py_INCREF(a);\n                return (PyObject *)a;\n        }\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) \n\t\treturn PyArray_Newshape(a, &newdim);\n\telse\n\t        return PyArray_Flatten(a, fortran);\n}\n\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tsize = PyArray_SIZE(a);\n\tret = PyArray_New(a->ob_type,\n\t\t\t  1, &size,\n\t\t\t  a->descr->type_num,\n\t\t\t  NULL,\n                          NULL,\n\t\t\t  a->itemsize,\n\t\t\t  0, (PyObject *)a);\n\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\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\n/* Returns a new array \n   with the a new shape from the data\n   in the old array\n*/\n\nstatic PyObject * \nPyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims)\n{\n        intp i, s_original, i_unknown, s_known;\n        intp *dimensions = newdims->ptr;\n        PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n        Bool same;\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<n) {\n                        if (PyArray_DIM(self,i) != dimensions[i]) \n                                same=FALSE;\n                        i++;\n                }\n                if (same) return PyArray_View(self, NULL);\n        }\n\n        if (!PyArray_ISCONTIGUOUS(self)) {\n                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"changing shape only works on contiguous arrays\");\n                return NULL;\n        }\n\t\n        s_known = 1;\n        i_unknown = -1;\n\n        for(i=0; i<n; i++) {\n                if (dimensions[i] < 0) {\n                        if (i_unknown == -1) {\n                                i_unknown = i;\n                        } else {\n                                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"can only specify one \"\t\\\n\t\t\t\t\t\t\" unknown dimension\");\n                                goto fail;\n                        }\n                } else {\n\t\t\ts_known *= dimensions[i];\n                }\n        }\n\t\n        s_original = PyArray_SIZE(self);\n\t\n        if (i_unknown >= 0) {\n                if ((s_known == 0) || (s_original % s_known != 0)) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n                dimensions[i_unknown] = s_original/s_known;\n        } else {\n                if (s_original != s_known) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n        }\n        \n\tret = (PyAO *)PyArray_New(self->ob_type,\n\t\t\t\t  n, dimensions,\n\t\t\t\t  self->descr->type_num,\n\t\t\t\t  NULL,\n\t\t\t\t  self->data,\n\t\t\t\t  self->itemsize,\n\t\t\t\t  self->flags, (PyObject *)self);\n\n\tif (ret== NULL)\n                goto fail;\n\t\n        Py_INCREF(self);\n        ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n        return (PyObject *)ret;\n\t\n fail:\n        return NULL;\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\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; i<nd; i++) {\n\t\tif (self->dimensions[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\tret = PyArray_New(self->ob_type, newnd, dimensions, \n\t\t\t  self->descr->type_num, strides,\n\t\t\t  self->data, self->itemsize, self->flags,\n\t\t\t  (PyObject *)self);\n\tself->flags &= ~OWN_DATA;\n\tself->base = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\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\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype)\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; i<n; i++) {\n\t\tif (i==axis) val = 1;\n\t\telse val = PyArray_DIM(new,i);\n\t\tPyTuple_SET_ITEM(newshape, i, PyInt_FromLong((long)val));\n\t}\n\tobj2 = PyArray_Reshape((PyAO *)obj1, newshape);\n\tPy_DECREF(obj1);\n\tPy_DECREF(newshape);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x = x - mx */\n\tobj1 = PyNumber_Subtract((PyObject *)self, obj2);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x * x */\n\tobj2 = PyNumber_Multiply(obj1, obj1);\n\tPy_DECREF(obj1);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute add.reduce(x*x,axis) */\n\tobj1 = PyArray_GenericReduceFunction((PyArrayObject *)obj2, n_ops.add,\n\t\t\t\t\t     axis, rtype);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\tn = PyArray_DIM(new,axis)-1;\n\tPy_DECREF(new);\n\tif (n==0) n=1;\n\tobj2 = PyFloat_FromDouble(1.0/((double )n));\n\tif (obj2 == NULL) {Py_DECREF(obj1); return NULL;}\n\tret = PyArray_EnsureArray(PyNumber_Multiply(obj1, obj2));\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\n\t/* sqrt() */\n\tobj1 = PyArray_GenericUnaryFunction((PyAO *)ret, n_ops.sqrt);\n\tPy_DECREF(ret);\n\n\treturn obj1;\n}\n\n\nstatic PyObject *\nPyArray_Sum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis, \n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Prod(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.multiply, axis,\n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumSum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumProd(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, \n\t\t\t\t\t\tn_ops.multiply, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Any(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_or, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_All(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_and, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Compress(PyArrayObject *self, PyObject *condition, int axis)\n{\n        PyArrayObject *cond;\n\tPyObject *res, *ret;\n\n        cond = (PyAO *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n        if (cond == NULL) return NULL;\n        \n        if (cond->nd != 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\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; i<size; i++) {\n\t\tif (self->descr->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; i<size; i++) {\n\t\t\tif (self->descr->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; j<n; j++) {\n\t\t\titem = PyArray_New(self->ob_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\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tif (item == NULL) goto fail;\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; i<size; i++) {\n\t\t\tif (self->descr->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; j<n; j++) \n\t\t\t\t\t*(dptr[j])++ = it->coordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n        \n}\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)) goto fail;\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) goto fail;\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(res1);\n\tPy_XDECREF(res2);\n\tPy_XDECREF(two);\n\tPy_XDECREF(selector);\n\treturn NULL;\n}\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_Copy(self);\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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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\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\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyObject *newaxes;\n\tint i, pos;\t\n\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 = PyTuple_New(n);\n\tif (newaxes==NULL) return NULL;\n\t/* insert at the end */\n\tPyTuple_SET_ITEM(newaxes, n-2, PyInt_FromLong((long)axis1));\n\tPyTuple_SET_ITEM(newaxes, n-1, PyInt_FromLong((long)axis2));\n\tpos = 0;\n\tfor (i=0; i<n; i++) {\n\t\tif ((i==axis1) || (i==axis2)) continue;\n\t\tPyTuple_SET_ITEM(newaxes, pos++, \n\t\t\t\t PyInt_FromLong((long) i));\n\t}\n\tnew = PyArray_Transpose(self, newaxes);\n\tPy_DECREF(newaxes);\n\tif (new == NULL) return NULL;\n\tself = (PyAO *)new;\n\t\n\tif (n == 2) {\n\t\tPyObject *a=NULL, *indices=NULL, *ret=NULL;\n\t\tintp n1, n2, start, stop, step, count;\n\t\tintp *dptr;\n\t\tn1 = self->dimensions[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; n1<stop; n1+=step) *dptr++ = n1;\n\t\ta = PyArray_IterNew((PyObject *)self);\n\t\tPy_DECREF(self);\n\t\tif (a == NULL) {Py_DECREF(indices); return NULL;}\n\t\tret = PyObject_GetItem(a, indices);\n\t\tPy_DECREF(a);\n\t\tPy_DECREF(indices);\n\t\treturn ret;\n\t}\t\n\n\telse {\n\t\t/* \n\t\t   my_diagonal = []\n\t\t   for i in range (s [0]) :\n\t\t       my_diagonal.append (diagonal (a [i], offset))\n\t\t   return array (my_diagonal)\t\n\t\t*/\t\n\t\tPyObject *mydiagonal=NULL, *new=NULL, *ret=NULL, *sel=NULL;\n\t\tintp i, n1;\n\t\tint res;\n\t\tPyArray_Typecode typecode;\n\n\t\ttypecode.type_num = self->descr->type_num;\n\t\ttypecode.itemsize = self->itemsize;\n\t\ttypecode.fortran = 0;\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<n1; i++) {\n\t\t\tnew = PyInt_FromLong((long) i);\n\t\t\tsel = PyArray_EnsureArray(PyObject_GetItem((PyObject *)self, new));\n\t\t\tPy_DECREF(new);\n\t\t\tif (sel == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnew = PyArray_Diagonal((PyAO *)sel, offset, n-3, n-2);\n\t\t\tPy_DECREF(sel);\n\t\t\tif (new == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tres = PyList_Append(mydiagonal, new);\n\t\t\tPy_DECREF(new);\n\t\t\tif (res < 0) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(self);\n\t\tret =  PyArray_FromAny(mydiagonal, &typecode, 0, 0, 0);\n\t\tPy_DECREF(mydiagonal);\n\t\treturn ret;\n\t}\n}\n\n\n\n\n\n\n/* simulates a C-style 1-3 dimensional array which can be accesed using \n    ptr[i]  or ptr[i][j] or ptr[i][j][k] -- requires pointer allocation \n    for 2-d and 3-d.\n\n    Especially for 2-d and up, ptr is NOT equivalent to a statically defined\n    2-d or 3-d array.  In particular, it cannot be passed into a \n    function that requires a true pointer to a fixed-size array. \n*/\n\nstatic int\nPyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, int type_num) \n{\n\tPyArrayObject *ap;\n\tPyArray_Typecode typecode = {0, 0, 0};\n\tintp n, m, i, j;\n\tchar **ptr2;\n\tchar ***ptr3;\n\n\ttypecode.type_num = type_num;\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot treat flexible type as C array.\");\n\t\treturn -1;\n\t}\n\tif ((nd < 1) || (nd > 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"Only Carrays of 1-3 dimensions available.\");\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, &typecode, 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 **)malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr2[i] = ap->data + 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 ***)malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr3[i] = ptr3[n + (m-1)*i];\n\t\t\tfor (j=0; j<m; j++) {\n\t\t\t\tptr3[i][j] = ap->data + 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\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, typecode) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, typecode) == -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\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\tfree(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<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\tarr = PyArray_FROM_O(otmp);\n\t\tPy_DECREF(otmp);\n\t\tif (arr==NULL) goto fail;\n\t\totmp = PyArray_SwapAxes((PyArrayObject *)arr, axis, 0);\n\t\tPy_DECREF(arr);\n\t\tif (otmp == NULL) goto fail;\n\t\tPyTuple_SET_ITEM(newtup, i, otmp);\n\t}\n\totmp = PyArray_Concatenate(newtup, 0);\n\tPy_DECREF(newtup);\n\tif (otmp == NULL) return NULL;\n\tarr = PyArray_SwapAxes((PyArrayObject *)otmp, axis, 0);\n\tPy_DECREF(otmp);\n\treturn arr;\n\t\n fail:\n\tPy_DECREF(newtup);\n\treturn NULL;\n}\n\n/*op is a python object supporting the sequence interface.\n  Its elements will be concatenated together to form a single \n  multidimensional array.*/\n/* If axis is MAX_DIMS or bigger, then each sequence object will \n   be flattened before concatenation \n*/\nstatic PyObject *\nPyArray_Concatenate(PyObject *op, int axis) \n{\n\tPyArrayObject *ret, **mps;\n\tPyObject *otmp;\n\tint i, n, type_num, tmp, nd=0, new_dim;\n\tchar *data;\t\n\tPyTypeObject *subtype;\n\tdouble prior1, prior2;\n\tintp numbytes;\n\n\tn = PySequence_Length(op);\n\tif (n == -1) {\n\t\treturn NULL;\n\t}\n\tif (n == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Concatenation of zero-length sequences is \"\\\n\t\t\t\t\"impossible.\");\n\t\treturn NULL;\n\t}\n\n\tif ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS)))\n\t\treturn _swap_and_concat(op, axis, n);\n\t\n\tret = NULL;\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\t/* Make sure these arrays are legal to concatenate. */\n\t/* Must have same dimensions except d0, and have coercible type. */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays \"\\\n\t\t\t\t\"to concatenate\");\n\t\tgoto fail;\n\t}\n\n\tprior1 = 0.0;\n\tsubtype = &PyArray_Type;\n\tret = NULL;\n\tfor(i=0; i<n; i++) {\n\t\tPyArray_Typecode typecode = {0, 0, 0};\n\t\ttypecode.type_num = type_num;\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) goto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_FromAny(otmp, &typecode, 0, 0, CARRAY_FLAGS);\n\t\tPy_DECREF(otmp);\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (axis >= 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; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (i == 0) nd = mps[i]->nd;\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\"0d 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\tret = (PyArrayObject *)PyArray_New(subtype, nd,\n\t\t\t\t\t   mps[0]->dimensions, \n\t\t\t\t\t   type_num, NULL, NULL, 0, 0,\n                                           (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; i<n; i++) {\n\t\tnumbytes = PyArray_NBYTES(mps[i]);\n\t\tmemcpy(data, mps[i]->data, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)\n{\n\tPyObject *new_axes;\n\tint n, i, val;\n\tPyObject *ret;\n\n\tif (a1 == a2) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\t\n\tn = ap->nd;\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 = PyTuple_New(n);\n\tfor (i=0; i<n; i++) {\n\t\tif (i == a1) val = a2;\n\t\telse if (i == a2) val = a1;\n\t\telse val = i;\n\t\tPyTuple_SET_ITEM(new_axes, i, PyInt_FromLong((long) val));\n\t}\n\tret = PyArray_Transpose(ap, new_axes);\n\tPy_DECREF(new_axes);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Transpose(PyArrayObject *ap, PyObject *op) {\n\tintp *axes, axis;\n\tintp i, n;\n\tintp *permutation = NULL;\n\tPyArrayObject *ret = NULL;\n\t\n\tif (op == Py_None || op == NULL) {\n\t\tn = ap->nd;\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\tfor(i=0; i<n; i++)\n\t\t\tpermutation[i] = n-1-i;\n\t} else {\n\t\tif (PyArray_AsCArray(&op, (char **)&axes, &n, 1,\n\t\t\t\t PyArray_INTP) == -1)\n\t\t\treturn NULL;\n\t\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\n\t\tfor(i=0; i<n; i++) {\n\t\t\taxis = axes[i];\n\t\t\tif (axis < 0) axis = ap->nd+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\tgoto fail;\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\tret = (PyArrayObject *)PyArray_New(ap->ob_type, n, permutation, \n\t\t\t\t\t   ap->descr->type_num, NULL,\n\t\t\t\t\t   ap->data, ap->itemsize, ap->flags,\n\t\t\t\t\t   (PyObject *)ap);\n\tif (ret == NULL) goto fail;\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; i<n; i++) {\n\t\tret->dimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n\tif (op && (op != Py_None))\n\t\tPyArray_Free(op, (char *)axes);\n\tfree(permutation);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tif (permutation != NULL) free(permutation);\n\tif (op != Py_None)\n\t\tPyArray_Free(op, (char *)axes);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\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_ContiguousFromObject(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; j<n; j++) {\n\t\t\tif (counts[j] < 0) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \"count < 0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\ttotal += counts[j];\n\t\t}\n\t}\n\n\n\t/* Construct new array */\n\taop->dimensions[axis] = total;\n\tret = (PyArrayObject *)PyArray_New(aop->ob_type, aop->nd,\n\t\t\t\t\t   aop->dimensions, \n\t\t\t\t\t   aop->descr->type_num,\n\t\t\t\t\t   NULL, NULL, aop->itemsize, 0,\n\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->itemsize;\n\tfor(i=axis+1; i<aop->nd; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; i<axis; i++) n_outer *= aop->dimensions[i];\n\n\tfor(i=0; i<n_outer; i++) {\n\t\tfor(j=0; j<n; j++) {\n\t\t\ttmp = (nd ? counts[j] : counts[0]);\n\t\t\tfor(k=0; k<tmp; k++) {\n\t\t\t\tmemcpy(new_data, old_data, chunk);\n\t\t\t\tnew_data += chunk;\n\t\t\t}\n\t\t\told_data += chunk;\n\t\t}\n\t}\n\n\tPy_DECREF(repeats);\n\tPyArray_INCREF(ret);\n\tPy_XDECREF(aop);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_DECREF(repeats);\n\tPy_XDECREF(aop);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\nstatic PyObject *\nPyArray_Choose(PyArrayObject *ip, PyObject *op) {\n\tintp i, n, *sizes, m, offset, elsize, type_num;\n\tchar *ret_data;\n\tPyArrayObject **mps, *ap, *ret;\n\tPyObject *otmp;\n\tintp *self_data, mi;\n\tap = NULL;\n\tret = NULL;\n\t\n\tn = PySequence_Length(op);\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\tsizes = (intp *)malloc(n*sizeof(intp));\n\t\n\t/* Figure out the right type for the new array */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays to \"\\\n\t\t\t\t\"choose from\");\n\t\tgoto fail;\n\t}\n\t\n\t/* Make sure all arrays are actual array objects. */\n\tfor(i=0; i<n; i++) {\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n\t\t\tgoto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_ContiguousFromObject(otmp, type_num, \n\t\t\t\t\t\t     0, 0);\n\t\tPy_DECREF(otmp);\n\t}\n\t\n\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)ip, \n\t\t\t\t\t\t\t   PyArray_INTP, \n\t\t\t\t\t\t\t   0, 0);\n\tif (ap == NULL) goto fail;\n\t\n\t/* Check the dimensions of the arrays */\n\tfor(i=0; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (ap->nd < 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\t/* why not ??? \n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Not implemented for flexible sizes\");\n\t\treturn NULL;\n\t}\n\t*/\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->itemsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i<m; i++) {\n\t\tmi = *self_data;\n\t\tif (mi < 0 || mi >= 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; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_DECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\n\treturn (PyObject *)ret;\n\t\n fail:\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_XDECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\tPy_XDECREF(ret);\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->compare(a,b,global_obj);\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#define SWAPBACK(op, ap) { \\\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\nstatic PyObject *\nPyArray_Sort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tif ((ap = (PyAO*) _check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_CopyFromObject((PyObject *)op, \n\t\t\t\t\t\t     PyArray_NOTYPE,\n\t\t\t\t\t\t     1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\n\tif (ap->descr->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\n\t}\n\t\n\telsize = ap->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\tqsort(ip, m, elsize, qsortCompare);\n\t}\n\t\n\tglobal_obj = store_arr;\n\t\t\n\tif (PyErr_Occurred()) {\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\t\n\t}\n\n finish:\n\tSWAPBACK(op, ap);\n\n\treturn (PyObject *)op;\n}\n\n\nstatic char *global_data;\n\nstatic int \nargsort_static_compare(const void *ip1, const void *ip2) \n{\n\tint isize = global_obj->itemsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->compare(global_data + (isize * *ipa),\n                                          global_data + (isize * *ipb), \n\t\t\t\t\t  global_obj);\n}\n\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap, *ret, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tif ((ap = (PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op, \n\t\t\t\t\t\t\t   PyArray_NOTYPE,\n\t\t\t\t\t\t\t   1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, PyArray_INTP,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\tif (ap->descr->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\tip = (intp *)ret->data;\n\targsort_elsize = ap->itemsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\tstore_ptr = global_data;\n\tglobal_data = ap->data;\n\tstore = global_obj;\n\tglobal_obj = ap;\n\tfor (i=0; i<n; i++, ip+=m, global_data += m*argsort_elsize) {\n\t\tfor(j=0; j<m; j++) ip[j] = j;\n\t\tqsort((char *)ip, m, sizeof(intp),\n\t\t      argsort_static_compare);\n\t}\n\tglobal_data = store_ptr;\n\tglobal_obj = store;\n\n\n finish:\n\tPy_DECREF(ap);\n\tSWAPBACK(op, ret);\n\treturn (PyObject *)op;\n\n fail:\n\tPy_XDECREF(ap);\n\tPy_XDECREF(ret);\n\treturn NULL;\n\n}  \n\nstatic void \nlocal_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret)\n{\t\n\tPyArray_CompareFunc *compare = ap2->descr->compare;\n\tintp  min_i, max_i, i, j;\n\tint location, elsize = ap1->itemsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_Size((PyObject *)ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j<n; j++, ip+=elsize, rp++) {\n\t\tmin_i = 0;\n\t\tmax_i = elements;\n\t\twhile (min_i != max_i) {\n\t\t\ti = (max_i-min_i)/2 + min_i;\n\t\t\tlocation = compare(ip, vp+elsize*i, ap2);\n\t\t\tif (location == 0) {\n\t\t\t\twhile (i > 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\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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_ContiguousFromObject((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_ContiguousFromObject(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->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\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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->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->itemsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2*l;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1*l;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\t\t\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/* just like inner product but does the swapaxes stuff on the fly */\nstatic PyObject *\nPyArray_MatrixProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tintp matchDim, otherDim, is2r, is1r;\n\tPyTypeObject *subtype;\n        double prior1, prior2;\n        \n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\t\n\t\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(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\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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<j; i++) \n\t   fprintf(stderr, \"%d \", dimensions[i]);\n\t   fprintf(stderr, \"\\n\"); \n\t*/\n\n        /* Choose which subtype to return */\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->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->itemsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2r;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1r;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\n\t\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\nstatic PyObject *\nPyArray_CopyAndTranspose(PyObject *op) \n{\n\tPyObject *ret, *arr;\n\tint nd;\n\tintp dims[2];\n\tintp i,j;\n\tint elsize, str2;\n\tchar *iptr;\n\tchar *optr;\n\n\t/* make sure it is well-behaved */\n\tarr = PyArray_FromAny(op, NULL, 0, 0, CARRAY_FLAGS);\n\tnd = PyArray_NDIM(arr);\n\tif (nd == 1) {     /* we will give in to old behavior */\n\t\tret = PyArray_Copy((PyArrayObject *)arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\t\t\n\t}\n\telse if (nd != 2) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Only 2-d arrays are allowed.\");\n\t\treturn NULL;\n\t}\n\n\t/* Now construct output array */\n\tdims[0] = PyArray_DIM(arr,1);\n\tdims[1] = PyArray_DIM(arr,0);\n\telsize = PyArray_ITEMSIZE(arr);\n\n\tret = PyArray_New(arr->ob_type, 2, dims, PyArray_TYPE(arr),\n\t\t\t  NULL, NULL, elsize, 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; i<dims[0]; i++) {\n\t\tiptr = PyArray_DATA(arr) + i*elsize;\n\t\tfor (j=0; j<dims[1]; j++) {\n\t\t\t/* optr[i,j] = iptr[j,i] */\n\t\t\tmemcpy(optr, iptr, elsize);\n\t\t\toptr += elsize;\n\t\t\tiptr += str2;\n\t\t}\n\t}\n\tPy_DECREF(arr);\n\treturn ret;\n}\n \nstatic PyObject *\nPyArray_Correlate(PyObject *op1, PyObject *op2, int mode) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\n\tintp length;\n\tint i, n1, n2, n, n_left, n_right;\n\tint typenum;\n\tint is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tPyArray_DotFunc *dot;\n\t\n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\t\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    1, 1);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum, \n\t\t\t\t\t\t\t    1, 1);\n\tif (ap2 == NULL) goto fail;\n\t\n\tn1 = ap1->dimensions[ap1->nd-1];\n\tn2 = ap2->dimensions[ap2->nd-1];\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 = (int)(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\t\n\tret = (PyArrayObject *)PyArray_New(ap1->ob_type, 1,\n\t\t\t\t\t   &length, typenum, \n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)ap1);\n\tif (ret == NULL) goto fail;\n\n\t\n\tdot = ret->descr->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->itemsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; i<n_left; i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tn++;\n\t\tip2 -= is2;\n\t\top += os;\n\t}\n\tfor(i=0; i<(n1-n2+1); i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tfor(i=0; i<n_right; i++) {\n\t\tn--;\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tif (PyErr_Occurred()) goto fail;\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\nstatic PyObject *\nPyArray_ArgMin(PyArrayObject *ap, int axis) \n{\n\tPyObject *obj, *new, *ret;\n\n\tif (PyArray_ISFLEXIBLE(ap)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"argmax is unsupported for this type.\");\n\t\treturn NULL;\n\t}\n\telse if (PyArray_ISUNSIGNED(ap)) \n\t\tobj = PyInt_FromLong((long) -1);\n\t\n\telse if (PyArray_TYPE(ap)==PyArray_BOOL) \n\t\tobj = PyInt_FromLong((long) 1);\n\t\n\telse \n\t\tobj = PyInt_FromLong((long) 0);\n\t\n\tnew = PyNumber_Subtract(obj, (PyObject *)ap);\n\tif (new == NULL) return NULL;\n\n\tPy_DECREF(obj);\n\tret = PyArray_ArgMax((PyArrayObject *)new, axis);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Max(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.maximum, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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\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_ContiguousFromObject((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->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->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\targ_func(ip, m, rptr, ap);\n\t\trptr += 1;\n\t}\n\tPy_DECREF(ap);\n\n\tSWAPBACK(op, rp);     /* op now contains the return */\n  \n\treturn (PyObject *)op;\n\t\n fail:\n\tPy_DECREF(ap);\n\tPy_XDECREF(rp);\n\treturn NULL;\n}  \n\n\nstatic PyObject *\nPyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n        PyArrayObject *self, *indices, *ret;\n        intp nd, i, j, n, m, max_item, tmp, chunk;\n\tintp shape[MAX_DIMS];\n        char *src, *dest;\n\t\n        indices = ret = NULL;\n\tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n        if (self == NULL) return NULL;\n\t\n        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, \n\t\t\t\t\t\t\t\tPyArray_INTP, \n\t\t\t\t\t\t\t\t1, 0);\n        if (indices == NULL) goto fail;\n\t\n        n = m = chunk = 1;\n        nd = self->nd + 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        ret = (PyArrayObject *)PyArray_New(self->ob_type, nd, shape, \n\t\t\t\t\t   self->descr->type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)self);\n\t\n        if (ret == NULL) goto fail;\n\t\n        max_item = self->dimensions[axis];\n        chunk = chunk * ret->itemsize;\n        src = self->data;\n        dest = ret->data;\n\t\n        for(i=0; i<n; i++) {\n                for(j=0; j<m; j++) {\n                        tmp = ((intp *)(indices->data))[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\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0) \n{\n        PyArrayObject  *indices, *values;\n        int i, chunk, ni, max_item, nv, tmp; \n        char *src, *dest;\n\n        indices = NULL;\n        values = NULL;\n\n        if (!PyArray_Check(self)) {\n                PyErr_SetString(PyExc_ValueError, \"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->itemsize;\n\n        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, PyArray_INTP, 0, 0);\n        if (indices == NULL) goto fail;\n        ni = PyArray_SIZE(indices);\n\n        values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromObject(values0, self->descr->type_num, \n\t\t\t\t\t     0, 0);\n        if (values == NULL) goto fail;\n        nv = PyArray_SIZE(values);\n        if (nv > 0) { /* nv == 0 for a null array */\n                for(i=0; i<ni; i++) {\n                        src = values->data + 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        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\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0) \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_ValueError, \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->itemsize;\n\n        mask = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromObject(mask0, PyArray_BOOL, 0, 0);\n        if (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_ContiguousFromObject(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\t\tfor(i=0; i<ni; i++) {\n\t\t\tsrc = values->data + chunk * (i % nv);\n\t\t\ttmp = ((Bool *)(mask->data))[i];\n\t\t\tif (tmp) {\n\t\t\t\tmemmove(dest + i * chunk, src, chunk);\n\t\t\t\tif (thistype == PyArray_OBJECT)\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\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    \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\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{\n\tif (PyObject_IsTrue(object)) *val=TRUE;\n\telse *val=FALSE;\n\tif (PyErr_Occurred()) return PY_FAIL;\n\treturn PY_SUCCEED;\n}\n\n\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (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\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n        int buflen;\n\n        buf->ptr = NULL;\n        buf->flags = WRITEABLE;\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\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) goto fail;\n        return PY_SUCCEED;\n\n fail:\n\tPyDimMem_FREE(seq->ptr);\n\treturn PY_FAIL;\n}\n\n/* This function takes a Python object representing a type and converts it \n   to a C type_num and an itemsize (elements of PyArray_Typecode structure)\n   \n   Many objects can be used to represent a type.\n */\n\nstatic int\nPyArray_TypecodeConverter(PyObject *obj, PyArray_Typecode *at)\n{\n        char *type;\n        PyArray_Descr *descr;\n        int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item, *attr=NULL;\n\n\tat->itemsize = 0;\n        if (obj == Py_None) {\n                at->type_num = PyArray_NOTYPE;\n                return PY_SUCCEED;\n        }\n\n        if (PyType_Check(obj) && PyType_IsSubtype((PyTypeObject *)obj, \n                                                  &PyGenericArrType_Type)) {\n                PyArray_TypecodeFromTypeObject(obj, at);\n                return PY_SUCCEED;\n        }\n\n\n\t/* type object could be an array */\n\tif (PyArray_Check(obj)) {\n\t\tat->type_num = PyArray_TYPE(obj);\n\t\tat->itemsize = PyArray_ITEMSIZE(obj);\n\t\treturn PY_SUCCEED;\n\t}\n\n\t/* or an array scalar */\n        if (PyArray_IsScalar(obj, Generic)) {\n                PyArray_TypecodeFromScalar(obj, at);\n                return PY_SUCCEED;\n        }\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);\t\t\n\t\tif (len > 0) {\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tif (len > 1) {\n\t\t\tat->itemsize = atoi(type+1);\n\t\t\t/* When specifying length of UNICODE\n\t\t\t   the number of characters is given to match \n\t\t\t   the STRING interface.  Each character can be\n\t\t\t   more than one byte and itemsize must be\n\t\t\t   the number of bytes.\n\t\t\t*/\n\t\t\tif (check_num == PyArray_UNICODELTR ||\t\\\n\t\t\t    check_num == PyArray_UNICODE) \n\t\t\t  at->itemsize *= sizeof(Py_UNICODE);\n\n\t\t\t/* Support for generic processing */\n\t\t\telse if ((check_num != PyArray_STRINGLTR) &&\n\t\t\t\t (check_num != PyArray_VOIDLTR) &&\n\t\t\t\t (check_num != PyArray_STRING) &&\n\t\t\t\t (check_num != PyArray_VOID)) {\n\t\t\t\tcheck_num = \\\n\t\t\t\t\tPyArray_TypestrConvert(at->itemsize,\n\t\t\t\t\t\t\t       check_num);\n\t\t\t        at->itemsize = 0;\n\t\t\t\tif (check_num == PyArray_NOTYPE) goto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Arbitray object with dtypenum and itemsize attributes. */\n\telse if (PyObject_HasAttrString(obj, \"dtypenum\") && \n\t    PyObject_HasAttrString(obj, \"itemsize\")) {\n\t\tattr = PyObject_GetAttrString(obj, \"dtypenum\");\n\t\tcheck_num = PyInt_AsLong(attr);\n\t\tif (PyErr_Occurred()) {  /* not an integer, try character */\n\t\t\tPyErr_Clear();\n\t\t\ttype = PyString_AsString(attr);\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tif (!PyErr_Occurred()) {\n\t\t\tattr = PyObject_GetAttrString(obj, \"itemsize\");\n\t\t\tat->itemsize = PyInt_AsLong(attr);\n\t\t\tPy_XDECREF(attr);\n\t\t}\t\t\t\n\t}\t\t\n\telse if (PyType_Check(obj)) {\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 *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\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                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}\t\n        else { /* Default -- try integer conversion */\n                check_num = PyInt_AsLong(obj);\n\t}\n\n\tif (PyErr_Occurred()) goto fail;\n\n\t/*\n\tif (check_num == PyArray_NOTYPE) return PY_FAIL;\n\t*/\n\tif (check_num == PyArray_NOTYPE) {\n\t\tat->type_num = PyArray_NOTYPE;\n\t\tat->itemsize = 0;\n\t\treturn PY_SUCCEED;\n\t}\n\n        if ((descr = PyArray_DescrFromType(check_num))==NULL) {\n\t\t/* Now check to see if the object is registered\n\t\t   in typeDict */\n\t\tif (typeDict != NULL) {\n\t\t\titem = PyDict_GetItem(typeDict, obj);\n\t\t\tif (item) {\n\t\t\t\tPyArray_TypecodeFromTypeObject(obj, at);\n\t\t\t\tPyErr_Clear();\n\t\t\t\treturn PY_SUCCEED;\n\t\t\t}\n\t\t}\n                return PY_FAIL;\n\t}\n\t\n        at->type_num = descr->type_num;\n\tif (at->itemsize == 0) at->itemsize = descr->elsize;\n\t\n        return PY_SUCCEED;\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\treturn PY_FAIL;\n}\t\n\n\n/* This function returns true if the two typecodes are \n   equivalent (same basic kind and same itemsize).\n*/\n\nstatic Bool\nPyArray_EquivalentTypes(PyArray_Typecode *typ1, PyArray_Typecode *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->itemsize;\n\tregister int size2=typ2->itemsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typenum1==typenum2) return TRUE;\n\n\t/* If we are here then size1 == size2 */\n\tif (typenum1 < PyArray_FLOAT) {\n\t\tif (PyTypeNum_ISBOOL(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISBOOL(typenum2));\n\t\telse if (PyTypeNum_ISUNSIGNED(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISUNSIGNED(typenum2));\n\t\telse \n\t\t\treturn (Bool)(PyTypeNum_ISSIGNED(typenum2));\n\t}\n\telse {\n\t\tif (PyTypeNum_ISFLOAT(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISFLOAT(typenum2));\n\t\telse if (PyTypeNum_ISCOMPLEX(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISCOMPLEX(typenum2));\n\t}\n\t/* Default size1 != size2 and typenum1 != typenum2 */\n\treturn FALSE;\t\n}\n\nstatic Bool \nPyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n{\n        PyArray_Typecode type1={0,0,0};\n        PyArray_Typecode type2={0,0,0};\n\n\ttype1.type_num = PyArray_TYPE(a1);\n\ttype2.type_num = PyArray_TYPE(a2);\n\ttype1.itemsize = PyArray_ITEMSIZE(a1);\n\ttype2.itemsize = PyArray_ITEMSIZE(a2);\n\t\t\t\n        return PyArray_EquivalentTypes(&type1, &type2);\n}\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) will return a new array formed from the given object type given.  Object can anything with an __array__ method, or any (nested) sequence.  If no type is given, then the type will be determined as the minimum type required to hold the objects in the  sequence.  If copy is zero and sequence is already an array with the right type, a reference will be returned.  If the sequence is an array, type can be used only to upcast the array.  For downcasting use .astype(t) method.\";\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\", NULL};\n\tBool copy=TRUE;\n\tPyArray_Typecode type = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n\tint type_num;\n\tBool fortran=FALSE;\n\tint flags=0;\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&\", kwd, &op, \n\t\t\t\t\tPyArray_TypecodeConverter,\n                                        &type, \n\t\t\t\t\tPyArray_BoolConverter, &copy, \n\t\t\t\t\tPyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\ttype_num = type.type_num;\n\n\t/* fast exit if simple call */\n\tif (PyArray_Check(op) && (copy==0) &&\t\t\t\\\n\t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n\t\tif (type_num == PyArray_NOTYPE) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t\t/* One more chance */\n\t\toldtype.type_num = PyArray_TYPE(op);\n\t\toldtype.itemsize = PyArray_ITEMSIZE(op);\n\t\tif (PyArray_EquivalentTypes(&oldtype, &type)) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t}\n\n\ttype.fortran = fortran; \n\tif (copy) {\n\t\tflags = ENSURECOPY;\n\t}\n\n\tif ((ret = PyArray_FromAny(op, &type, 0, 0, flags)) == NULL) \n\t\treturn NULL;\n\n\treturn _ARET(ret);\n}\n\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n        \n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Empty(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypestr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. typestr must be a valid data typestr (complete with < > or |).  If dtypestr is object, 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[] = {\"dtypestr\",\"obj\", NULL};\n\tPyArray_Typecode typecode;\n\tPyObject *obj=NULL;\n\tchar *typestr;\n\tint typestrlen;\n\tint swap, alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"z#|O\",\n\t\t\t\t\t kwlist, &typestr, &typestrlen,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\n\tif (_array_typecode_fromstr(typestr, &swap, &typecode) < 0) \n\t\treturn NULL;\n\t\n\tif (typecode.itemsize == 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\tswap = 0;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = malloc(typecode.itemsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode.itemsize);\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_ValueError, \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.itemsize) {\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.type_num,\n\t\t\t     typecode.itemsize, swap); \n\n\t/* free dptr which contains zeros */\n\tif (alloc) free(dptr);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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 {\t\t\n\t\tmemset(ret->data, 0, n*(ret->itemsize));\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Zeros(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return 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\nstatic char doc_fromString[] = \"fromstring(string, dtype=intp, count=-1, swap=False) 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\tPyArrayObject *ret; \n\tchar *data;\n\tlonglong nin=-1;\n\tintp s, n;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", \"swap\",NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint itemsize;\n\tint swapped=FALSE;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&LO&\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &swapped)) {\n\t\treturn NULL;\n\t}\n\t\n\tn = (intp) nin;\n\n\titemsize = type.itemsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize.\");\n\t\treturn NULL;\n\t}\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\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\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\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype.type_num, NULL, \n\t\t\t\t\t\tNULL, itemsize, 0,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*ret->itemsize);\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPyArray_INCREF(ret);\n\treturn (PyObject *)ret;\n}\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\nstatic int\n_fill_in_itemsize(PyArray_Typecode *typecode)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(typecode->type_num);\n\tif (descr==NULL) return -1;\n\ttypecode->itemsize = descr->elsize;\n\treturn 0;\n}\n\n\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Typecode *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\n\tif (typecode->itemsize == 0) {\n\t\tif (_fill_in_itemsize(typecode) < 0) \n\t\t\treturn NULL;\n\t}\n\n\tif (num == -1 && sep == NULL) {  /* 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\tfseek(fp, (long) start, SEEK_SET);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \"Could not seek in file.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif (typecode->itemsize == 0) {\n\t\t\ttypecode->itemsize = numbytes;\n\t\t\tnum = 1;\n\t\t}\n\t\telse {\n\t\t\tnum = numbytes / typecode->itemsize;\n\t\t}\n\t}\n\t\n\tif (sep==NULL) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &num, \n\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t typecode->itemsize, 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->itemsize, 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 = PyArray_DescrFromType(typecode->type_num)->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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &num, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\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, r->itemsize, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->itemsize;\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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &size, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->itemsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, r->itemsize, 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->itemsize;\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->itemsize);\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->itemsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=intp, count=-1, sep='')\\n\"\\\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_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\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, \"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\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Typecode *type, \n\t\t   intp count, int swapped) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\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\treturn NULL;\n\t}\n\tif (type->itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Itemsize cannot be zero in type\");\n\t\treturn NULL;\n\t}\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\treturn NULL;\n\t\t}\n\t}\n\ts = (intp)ts;\t\n\tn = (intp)count;\n\titemsize = type->itemsize;\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\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\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype->type_num, NULL, \n\t\t\t\t\t\tdata, itemsize, DEFAULT_FLAGS,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPy_INCREF(buf);\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret; \t\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=intp, count=-1, swap=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 the buffer has data that is out\\n\" \\\n\t\"   not in machine byte-order, than set swap=1.  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;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", \n\t\t\t\t \"swap\", NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint swapped=0;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Li\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &swapped)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromBuffer(obj, &type, (intp)nin, swapped);\n}\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\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length, i;\n\tPyObject *range;\n\tchar *rptr;\n\tint elsize, type;\n\tdouble value;\n\tPyArray_Descr *dbl_descr;\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\tdbl_descr = PyArray_DescrFromType(PyArray_DOUBLE);\n    \n\trptr = ((PyArrayObject *)range)->data;\n\telsize = ((PyArrayObject *)range)->itemsize;\n\ttype = ((PyArrayObject *)range)->descr->type_num;\n\tfor (i=0; i < length; i++) {\n\t\tvalue = start + i*step;\n\t\tdbl_descr->cast[type]((char*)&value, rptr, 1, NULL, \n\t\t\t\t      (PyArrayObject *)range);\n\t\trptr += elsize;\n\t}\n    \n\treturn range;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=intp)\\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=Py_None, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tdouble start, stop, step;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0};\n\tint type_num;\n\tint deftype = PyArray_INTP;\n\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_TypecodeConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\tdeftype = PyArray_ObjectType(o_start, deftype);\n\tif (o_stop != Py_None) {\n\t\tdeftype = PyArray_ObjectType(o_stop, deftype);\n\t}\n\tif (o_step != NULL) {\n\t\tdeftype = PyArray_ObjectType(o_step, deftype);\n\t}\n\n\ttype_num = typecode.type_num;\n\tif (type_num == PyArray_NOTYPE) {\n\t\ttype_num = deftype;\n\t}\n\n\tstart = PyFloat_AsDouble(o_start);\n\tif error_converting(start) return NULL;\n\n\tif (o_step == NULL) {\n\t\tstep = 1;\n\t}\n\telse {\n\t\tstep = PyFloat_AsDouble(o_step);\n\t\tif error_converting(step) return NULL;\n\t}\n\n\tif (o_stop == Py_None) {\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\telse {\n\t\tstop = PyFloat_AsDouble(o_stop);\n\t\tif error_converting(stop) return NULL;\n\t}\n\n\treturn PyArray_Arange(start, stop, step, type_num);\n}\n\n#undef _ARET\n\n/*****\n      static char doc_arrayMap[] = \"arrayMap(func, [a1,...,an])\";\n\n      static PyObject *array_arrayMap(PyObject *dummy, PyObject *args) {\n      PyObject *shape, *a0;\n  \n      if (PyArg_ParseTuple(args, \"OO\", &a0, &shape) == NULL) return NULL;\n\t\n      return PyArray_Map(a0, shape);\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\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 (PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"One or more objects is not callable.\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\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\tif ((x==NULL) || (y==NULL)) {\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\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\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, n_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_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_Typecode d1={PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode d2={PyArray_NOTYPE, 0, 0};\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_TypecodeConverter, &d1,\n\t\t\t\t\tPyArray_TypecodeConverter, &d2))\n\t\treturn NULL;\n\tif (d1.type_num == PyArray_NOTYPE || \\\n\t    d2.type_num == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types. \"\\\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 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{\"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/*  {\"arrayMap\",\t(PyCFunction)array_arrayMap, \n\t    METH_VARARGS, doc_arrayMap},*/\n\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_Tyupe\",  \\\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(Numeric, Generic);\n        SINGLE_INHERIT(Integer, Numeric);\n        SINGLE_INHERIT(Inexact, Numeric);\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        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        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        SINGLE_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\t   \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, \"NOTSWAPPED\", s=PyInt_FromLong(NOTSWAPPED));\n        Py_DECREF(s);\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\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n                return; \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(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\n        set_flaginfo(d);\n\n\tif (set_typeinfo(d) == 0) \n                return;  /* otherwise there is an error */\n\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": "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": 51,
                        "end_line": 56,
                        "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": 59,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 68,
                        "end_line": 80,
                        "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": 83,
                        "end_line": 90,
                        "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_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 9,
                        "token_count": 245,
                        "parameters": [
                            "self",
                            "type"
                        ],
                        "start_line": 93,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Ravel",
                        "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 87,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 144,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Flatten",
                        "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 32,
                        "complexity": 5,
                        "token_count": 162,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 161,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 202,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Newshape",
                        "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)",
                        "filename": "multiarraymodule.c",
                        "nloc": 68,
                        "complexity": 15,
                        "token_count": 366,
                        "parameters": [
                            "self",
                            "newdims"
                        ],
                        "start_line": 219,
                        "end_line": 298,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Squeeze",
                        "long_name": "PyArray_Squeeze( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 4,
                        "token_count": 192,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 306,
                        "end_line": 337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 32,
                        "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": 341,
                        "end_line": 362,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 43,
                        "complexity": 12,
                        "token_count": 433,
                        "parameters": [
                            "self",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 365,
                        "end_line": 420,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "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": 424,
                        "end_line": 434,
                        "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": 437,
                        "end_line": 447,
                        "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": 450,
                        "end_line": 460,
                        "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": 463,
                        "end_line": 474,
                        "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": 477,
                        "end_line": 488,
                        "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": 491,
                        "end_line": 502,
                        "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": 506,
                        "end_line": 526,
                        "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": 50,
                        "complexity": 13,
                        "token_count": 403,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 529,
                        "end_line": 587,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Clip",
                        "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 6,
                        "token_count": 241,
                        "parameters": [
                            "self",
                            "min",
                            "max"
                        ],
                        "start_line": 590,
                        "end_line": 623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Conjugate",
                        "long_name": "PyArray_Conjugate( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 9,
                        "token_count": 225,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 626,
                        "end_line": 662,
                        "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": 665,
                        "end_line": 675,
                        "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": 106,
                        "complexity": 24,
                        "token_count": 808,
                        "parameters": [
                            "self",
                            "offset",
                            "axis1",
                            "axis2"
                        ],
                        "start_line": 678,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_AsCArray",
                        "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , int type_num)",
                        "filename": "multiarraymodule.c",
                        "nloc": 55,
                        "complexity": 13,
                        "token_count": 432,
                        "parameters": [
                            "op",
                            "ptr",
                            "dims",
                            "nd",
                            "type_num"
                        ],
                        "start_line": 816,
                        "end_line": 872,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 57,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_As1D",
                        "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "typecode"
                        ],
                        "start_line": 877,
                        "end_line": 885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 9,
                        "complexity": 2,
                        "token_count": 81,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "d2",
                            "typecode"
                        ],
                        "start_line": 889,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 904,
                        "end_line": 915,
                        "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": 919,
                        "end_line": 947,
                        "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": 114,
                        "complexity": 24,
                        "token_count": 771,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 956,
                        "end_line": 1084,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 129,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SwapAxes",
                        "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 37,
                        "complexity": 12,
                        "token_count": 227,
                        "parameters": [
                            "ap",
                            "a1",
                            "a2"
                        ],
                        "start_line": 1087,
                        "end_line": 1126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Transpose",
                        "long_name": "PyArray_Transpose( PyArrayObject * ap , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 49,
                        "complexity": 15,
                        "token_count": 403,
                        "parameters": [
                            "ap",
                            "op"
                        ],
                        "start_line": 1130,
                        "end_line": 1189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "qsortCompare",
                        "long_name": "qsortCompare( const * a , const * b)",
                        "filename": "multiarraymodule.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 1408,
                        "end_line": 1411,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 7,
                        "token_count": 250,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1433,
                        "end_line": 1482,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "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": 63,
                        "parameters": [
                            "ip1",
                            "ip2"
                        ],
                        "start_line": 1488,
                        "end_line": 1496,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "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": 1561,
                        "end_line": 1596,
                        "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": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "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": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 99,
                        "complexity": 20,
                        "token_count": 760,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1882,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyAndTranspose",
                        "long_name": "PyArray_CopyAndTranspose( PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 44,
                        "complexity": 6,
                        "token_count": 278,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 1885,
                        "end_line": 1936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 87,
                        "complexity": 13,
                        "token_count": 602,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1939,
                        "end_line": 2035,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 97,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgMin",
                        "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 5,
                        "token_count": 138,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2038,
                        "end_line": 2063,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Max",
                        "long_name": "PyArray_Max( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2066,
                        "end_line": 2077,
                        "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": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2080,
                        "end_line": 2091,
                        "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": 2094,
                        "end_line": 2117,
                        "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": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2121,
                        "end_line": 2178,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2182,
                        "end_line": 2254,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2257,
                        "end_line": 2309,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2312,
                        "end_line": 2374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 2386,
                        "end_line": 2398,
                        "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": 7,
                        "complexity": 3,
                        "token_count": 42,
                        "parameters": [
                            "object",
                            "val"
                        ],
                        "start_line": 2401,
                        "end_line": 2407,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypestrConvert",
                        "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)",
                        "filename": "multiarraymodule.c",
                        "nloc": 90,
                        "complexity": 33,
                        "token_count": 284,
                        "parameters": [
                            "itemsize",
                            "gentype"
                        ],
                        "start_line": 2411,
                        "end_line": 2520,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "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": 2535,
                        "end_line": 2560,
                        "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": 35,
                        "complexity": 10,
                        "token_count": 186,
                        "parameters": [
                            "obj",
                            "seq"
                        ],
                        "start_line": 2572,
                        "end_line": 2608,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypecodeConverter",
                        "long_name": "PyArray_TypecodeConverter( PyObject * obj , PyArray_Typecode * at)",
                        "filename": "multiarraymodule.c",
                        "nloc": 108,
                        "complexity": 33,
                        "token_count": 639,
                        "parameters": [
                            "obj",
                            "at"
                        ],
                        "start_line": 2617,
                        "end_line": 2755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 139,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivalentTypes",
                        "long_name": "PyArray_EquivalentTypes( PyArray_Typecode * typ1 , PyArray_Typecode * typ2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 24,
                        "complexity": 8,
                        "token_count": 162,
                        "parameters": [
                            "typ1",
                            "typ2"
                        ],
                        "start_line": 2763,
                        "end_line": 2790,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivArrTypes",
                        "long_name": "PyArray_EquivArrTypes( PyArrayObject * a1 , PyArrayObject * a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 80,
                        "parameters": [
                            "a1",
                            "a2"
                        ],
                        "start_line": 2793,
                        "end_line": 2804,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 282,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2826,
                        "end_line": 2877,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Empty",
                        "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 99,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2880,
                        "end_line": 2896,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_empty",
                        "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2902,
                        "end_line": 2926,
                        "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": 56,
                        "complexity": 11,
                        "token_count": 290,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2931,
                        "end_line": 2995,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 65,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Zeros",
                        "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 20,
                        "complexity": 3,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2999,
                        "end_line": 3021,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_zeros",
                        "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 22,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3027,
                        "end_line": 3051,
                        "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": 3058,
                        "end_line": 3067,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromString",
                        "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 8,
                        "token_count": 283,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3072,
                        "end_line": 3127,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fill_in_itemsize",
                        "long_name": "_fill_in_itemsize( PyArray_Typecode * typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "typecode"
                        ],
                        "start_line": 3142,
                        "end_line": 3149,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromFile",
                        "long_name": "PyArray_FromFile( FILE * fp , PyArray_Typecode * typecode , intp num , char * sep)",
                        "filename": "multiarraymodule.c",
                        "nloc": 113,
                        "complexity": 23,
                        "token_count": 682,
                        "parameters": [
                            "fp",
                            "typecode",
                            "num",
                            "sep"
                        ],
                        "start_line": 3153,
                        "end_line": 3280,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 128,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromfile",
                        "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 221,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3298,
                        "end_line": 3333,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromBuffer",
                        "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Typecode * type , intp count , int swapped)",
                        "filename": "multiarraymodule.c",
                        "nloc": 58,
                        "complexity": 11,
                        "token_count": 306,
                        "parameters": [
                            "buf",
                            "type",
                            "count",
                            "swapped"
                        ],
                        "start_line": 3336,
                        "end_line": 3399,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frombuffer",
                        "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 16,
                        "complexity": 2,
                        "token_count": 115,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3413,
                        "end_line": 3430,
                        "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": 3437,
                        "end_line": 3448,
                        "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": 3455,
                        "end_line": 3461,
                        "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": 3468,
                        "end_line": 3474,
                        "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": 3478,
                        "end_line": 3484,
                        "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": 3488,
                        "end_line": 3497,
                        "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": 29,
                        "complexity": 4,
                        "token_count": 229,
                        "parameters": [
                            "start",
                            "stop",
                            "step",
                            "type_num"
                        ],
                        "start_line": 3501,
                        "end_line": 3534,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_arange",
                        "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 10,
                        "token_count": 258,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 3540,
                        "end_line": 3588,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 11,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3608,
                        "end_line": 3619,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "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": 3,
                        "token_count": 67,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3625,
                        "end_line": 3642,
                        "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": 29,
                        "complexity": 8,
                        "token_count": 226,
                        "parameters": [
                            "condition",
                            "x",
                            "y"
                        ],
                        "start_line": 3646,
                        "end_line": 3682,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "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": 3690,
                        "end_line": 3698,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3704,
                        "end_line": 3715,
                        "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": 23,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3722,
                        "end_line": 3746,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 3806,
                        "end_line": 3915,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "set_flaginfo",
                        "long_name": "set_flaginfo( PyObject * d)",
                        "filename": "multiarraymodule.c",
                        "nloc": 23,
                        "complexity": 1,
                        "token_count": 171,
                        "parameters": [
                            "d"
                        ],
                        "start_line": 3920,
                        "end_line": 3946,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 52,
                        "complexity": 12,
                        "token_count": 361,
                        "parameters": [],
                        "start_line": 3951,
                        "end_line": 4027,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "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": 51,
                        "end_line": 56,
                        "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": 59,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 68,
                        "end_line": 80,
                        "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": 83,
                        "end_line": 90,
                        "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_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 9,
                        "token_count": 245,
                        "parameters": [
                            "self",
                            "type"
                        ],
                        "start_line": 93,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Ravel",
                        "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 87,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 144,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Flatten",
                        "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 32,
                        "complexity": 5,
                        "token_count": 162,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 161,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 202,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Newshape",
                        "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)",
                        "filename": "multiarraymodule.c",
                        "nloc": 68,
                        "complexity": 15,
                        "token_count": 366,
                        "parameters": [
                            "self",
                            "newdims"
                        ],
                        "start_line": 219,
                        "end_line": 298,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Squeeze",
                        "long_name": "PyArray_Squeeze( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 4,
                        "token_count": 192,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 306,
                        "end_line": 337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 32,
                        "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": 341,
                        "end_line": 362,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 43,
                        "complexity": 12,
                        "token_count": 433,
                        "parameters": [
                            "self",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 365,
                        "end_line": 420,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "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": 424,
                        "end_line": 434,
                        "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": 437,
                        "end_line": 447,
                        "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": 450,
                        "end_line": 460,
                        "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": 463,
                        "end_line": 474,
                        "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": 477,
                        "end_line": 488,
                        "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": 491,
                        "end_line": 502,
                        "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": 506,
                        "end_line": 526,
                        "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": 50,
                        "complexity": 13,
                        "token_count": 403,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 529,
                        "end_line": 587,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Clip",
                        "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 6,
                        "token_count": 241,
                        "parameters": [
                            "self",
                            "min",
                            "max"
                        ],
                        "start_line": 590,
                        "end_line": 623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Conjugate",
                        "long_name": "PyArray_Conjugate( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 9,
                        "token_count": 225,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 626,
                        "end_line": 662,
                        "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": 665,
                        "end_line": 675,
                        "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": 106,
                        "complexity": 24,
                        "token_count": 808,
                        "parameters": [
                            "self",
                            "offset",
                            "axis1",
                            "axis2"
                        ],
                        "start_line": 678,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_AsCArray",
                        "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , int type_num)",
                        "filename": "multiarraymodule.c",
                        "nloc": 55,
                        "complexity": 13,
                        "token_count": 432,
                        "parameters": [
                            "op",
                            "ptr",
                            "dims",
                            "nd",
                            "type_num"
                        ],
                        "start_line": 816,
                        "end_line": 872,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 57,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_As1D",
                        "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "typecode"
                        ],
                        "start_line": 877,
                        "end_line": 885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 9,
                        "complexity": 2,
                        "token_count": 81,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "d2",
                            "typecode"
                        ],
                        "start_line": 889,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 904,
                        "end_line": 915,
                        "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": 919,
                        "end_line": 947,
                        "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": 114,
                        "complexity": 24,
                        "token_count": 771,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 956,
                        "end_line": 1084,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 129,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SwapAxes",
                        "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 37,
                        "complexity": 12,
                        "token_count": 227,
                        "parameters": [
                            "ap",
                            "a1",
                            "a2"
                        ],
                        "start_line": 1087,
                        "end_line": 1126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Transpose",
                        "long_name": "PyArray_Transpose( PyArrayObject * ap , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 49,
                        "complexity": 15,
                        "token_count": 403,
                        "parameters": [
                            "ap",
                            "op"
                        ],
                        "start_line": 1130,
                        "end_line": 1189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "qsortCompare",
                        "long_name": "qsortCompare( const * a , const * b)",
                        "filename": "multiarraymodule.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 1408,
                        "end_line": 1411,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 7,
                        "token_count": 250,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1433,
                        "end_line": 1482,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "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": 63,
                        "parameters": [
                            "ip1",
                            "ip2"
                        ],
                        "start_line": 1488,
                        "end_line": 1496,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "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": 1561,
                        "end_line": 1596,
                        "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": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "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": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 99,
                        "complexity": 20,
                        "token_count": 760,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1882,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyAndTranspose",
                        "long_name": "PyArray_CopyAndTranspose( PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 44,
                        "complexity": 6,
                        "token_count": 278,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 1885,
                        "end_line": 1936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 87,
                        "complexity": 13,
                        "token_count": 602,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1939,
                        "end_line": 2035,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 97,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgMin",
                        "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 5,
                        "token_count": 138,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2038,
                        "end_line": 2063,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Max",
                        "long_name": "PyArray_Max( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2066,
                        "end_line": 2077,
                        "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": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2080,
                        "end_line": 2091,
                        "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": 2094,
                        "end_line": 2117,
                        "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": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2121,
                        "end_line": 2178,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2182,
                        "end_line": 2254,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2257,
                        "end_line": 2309,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2312,
                        "end_line": 2374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 2386,
                        "end_line": 2398,
                        "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": 7,
                        "complexity": 3,
                        "token_count": 42,
                        "parameters": [
                            "object",
                            "val"
                        ],
                        "start_line": 2401,
                        "end_line": 2407,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypestrConvert",
                        "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)",
                        "filename": "multiarraymodule.c",
                        "nloc": 90,
                        "complexity": 33,
                        "token_count": 284,
                        "parameters": [
                            "itemsize",
                            "gentype"
                        ],
                        "start_line": 2411,
                        "end_line": 2520,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "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": 2535,
                        "end_line": 2560,
                        "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": 35,
                        "complexity": 10,
                        "token_count": 186,
                        "parameters": [
                            "obj",
                            "seq"
                        ],
                        "start_line": 2572,
                        "end_line": 2608,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypecodeConverter",
                        "long_name": "PyArray_TypecodeConverter( PyObject * obj , PyArray_Typecode * at)",
                        "filename": "multiarraymodule.c",
                        "nloc": 108,
                        "complexity": 33,
                        "token_count": 639,
                        "parameters": [
                            "obj",
                            "at"
                        ],
                        "start_line": 2617,
                        "end_line": 2755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 139,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivalentTypes",
                        "long_name": "PyArray_EquivalentTypes( PyArray_Typecode * typ1 , PyArray_Typecode * typ2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 24,
                        "complexity": 8,
                        "token_count": 162,
                        "parameters": [
                            "typ1",
                            "typ2"
                        ],
                        "start_line": 2763,
                        "end_line": 2790,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivArrTypes",
                        "long_name": "PyArray_EquivArrTypes( PyArrayObject * a1 , PyArrayObject * a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 80,
                        "parameters": [
                            "a1",
                            "a2"
                        ],
                        "start_line": 2793,
                        "end_line": 2804,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 38,
                        "complexity": 9,
                        "token_count": 254,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2815,
                        "end_line": 2859,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 45,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Empty",
                        "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 99,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2862,
                        "end_line": 2878,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_empty",
                        "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2884,
                        "end_line": 2908,
                        "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": 56,
                        "complexity": 11,
                        "token_count": 290,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2913,
                        "end_line": 2977,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 65,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Zeros",
                        "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 20,
                        "complexity": 3,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2981,
                        "end_line": 3003,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_zeros",
                        "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 22,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3009,
                        "end_line": 3033,
                        "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": 3040,
                        "end_line": 3049,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromString",
                        "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 8,
                        "token_count": 283,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3054,
                        "end_line": 3109,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fill_in_itemsize",
                        "long_name": "_fill_in_itemsize( PyArray_Typecode * typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "typecode"
                        ],
                        "start_line": 3124,
                        "end_line": 3131,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromFile",
                        "long_name": "PyArray_FromFile( FILE * fp , PyArray_Typecode * typecode , intp num , char * sep)",
                        "filename": "multiarraymodule.c",
                        "nloc": 113,
                        "complexity": 23,
                        "token_count": 682,
                        "parameters": [
                            "fp",
                            "typecode",
                            "num",
                            "sep"
                        ],
                        "start_line": 3135,
                        "end_line": 3262,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 128,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromfile",
                        "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 221,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3280,
                        "end_line": 3315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromBuffer",
                        "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Typecode * type , intp count , int swapped)",
                        "filename": "multiarraymodule.c",
                        "nloc": 58,
                        "complexity": 11,
                        "token_count": 306,
                        "parameters": [
                            "buf",
                            "type",
                            "count",
                            "swapped"
                        ],
                        "start_line": 3318,
                        "end_line": 3381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frombuffer",
                        "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 16,
                        "complexity": 2,
                        "token_count": 115,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3395,
                        "end_line": 3412,
                        "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": 3419,
                        "end_line": 3430,
                        "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": 3437,
                        "end_line": 3443,
                        "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": 3450,
                        "end_line": 3456,
                        "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": 3460,
                        "end_line": 3466,
                        "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": 3470,
                        "end_line": 3479,
                        "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": 29,
                        "complexity": 4,
                        "token_count": 229,
                        "parameters": [
                            "start",
                            "stop",
                            "step",
                            "type_num"
                        ],
                        "start_line": 3483,
                        "end_line": 3516,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_arange",
                        "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 10,
                        "token_count": 258,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 3522,
                        "end_line": 3570,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 11,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3590,
                        "end_line": 3601,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "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": 3,
                        "token_count": 67,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3607,
                        "end_line": 3624,
                        "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": 29,
                        "complexity": 8,
                        "token_count": 226,
                        "parameters": [
                            "condition",
                            "x",
                            "y"
                        ],
                        "start_line": 3628,
                        "end_line": 3664,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "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": 3672,
                        "end_line": 3680,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3686,
                        "end_line": 3697,
                        "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": 23,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3704,
                        "end_line": 3728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 3788,
                        "end_line": 3897,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "set_flaginfo",
                        "long_name": "set_flaginfo( PyObject * d)",
                        "filename": "multiarraymodule.c",
                        "nloc": 23,
                        "complexity": 1,
                        "token_count": 171,
                        "parameters": [
                            "d"
                        ],
                        "start_line": 3902,
                        "end_line": 3928,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 52,
                        "complexity": 12,
                        "token_count": 361,
                        "parameters": [],
                        "start_line": 3933,
                        "end_line": 4009,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 282,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2826,
                        "end_line": 2877,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 3119,
                "complexity": 637,
                "token_count": 20324,
                "diff_parsed": {
                    "added": [
                        "static char doc_fromobject[] = \"array(object, dtype=None, copy=1, fortran=0, \"\\",
                        "        \"subok=0)\\n\"\\",
                        "        \"will return a new array formed from the given object type given.\\n\"\\",
                        "        \"Object can anything with an __array__ method, or any object\\n\"\\",
                        "        \"exposing the array interface, or any (nested) sequence.\\n\"\\",
                        "        \"If no type is given, then the type will be determined as the\\n\"\\",
                        "        \"minimum type required to hold the objects in the sequence.\\n\"\\",
                        "        \"If copy is zero and sequence is already an array with the right \\n\"\\",
                        "        \"type, a reference will be returned.  If the sequence is an array,\\n\"\\",
                        "        \"type can be used only to upcast the array.  For downcasting \\n\"\\",
                        "        \"use .astype(t) method.  If subok is true, then subclasses of the\\n\"\\",
                        "        \"array may be returned. Otherwise, a base-class ndarray is returned\";",
                        "\tstatic char *kwd[]= {\"object\", \"dtype\", \"copy\", \"fortran\", \"subok\",",
                        "                             NULL};",
                        "        Bool subok=FALSE;",
                        "\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&O&\", kwd, &op,",
                        "\t\t\t\t\tPyArray_BoolConverter, &fortran,",
                        "                                        PyArray_BoolConverter, &subok))",
                        "\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\",
                        "            (copy==0) &&                                             \\",
                        "        if (!subok) {",
                        "                flags |= ENSUREARRAY;",
                        "        }",
                        "\treturn ret;"
                    ],
                    "deleted": [
                        "static char doc_fromobject[] = \"array(object, dtype=None, copy=1, fortran=0) will return a new array formed from the given object type given.  Object can anything with an __array__ method, or any (nested) sequence.  If no type is given, then the type will be determined as the minimum type required to hold the objects in the  sequence.  If copy is zero and sequence is already an array with the right type, a reference will be returned.  If the sequence is an array, type can be used only to upcast the array.  For downcasting use .astype(t) method.\";",
                        "\tstatic char *kwd[]= {\"object\", \"dtype\", \"copy\", \"fortran\", NULL};",
                        "\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&\", kwd, &op,",
                        "\t\t\t\t\tPyArray_BoolConverter, &fortran))",
                        "\tif (PyArray_Check(op) && (copy==0) &&\t\t\t\\",
                        "\treturn _ARET(ret);"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/umathmodule.c.src",
                "new_path": "scipy/base/src/umathmodule.c.src",
                "filename": "umathmodule.c.src",
                "extension": "src",
                "change_type": "MODIFY",
                "diff": "@@ -1378,10 +1378,10 @@ static void\n \n /**begin repeat \n \n-#TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*2#\n-#OP= >*17, <*17#\n-#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble)*2#\n-#kind= maximum*17, minimum*17#\n+#TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#\n+#OP= >*14, <*14#\n+#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#\n+#kind= maximum*14, minimum*14#\n */\n static void \n @TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n@@ -1395,6 +1395,33 @@ static void\n }\n /**end repeat**/\n \n+/**begin repeat \n+\n+#TYPE=(CFLOAT,CDOUBLE,CLONGDOUBLE)*2#\n+#OP= >*3, <*3#\n+#typ=(cfloat, cdouble, clongdouble)*2#\n+#kind= maximum*3, minimum*3#\n+*/\n+static void \n+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n+{\n+\tregister intp i;\n+\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+\tchar *i1=args[0], *i2=args[1], *op=args[2];\n+        @typ@ *i1c, *i2c;\n+\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n+                i1c = (@typ@ *)i1;\n+                i2c = (@typ@ *)i2;\n+                if ((i1c->real @OP@ i2c->real) ||                       \\\n+                    ((i1c->real==i2c->real) && (i1c->imag @OP@ i2c->imag)))\n+                        memcpy(op, i1, sizeof(@typ@));\n+                else\n+                        memcpy(op, i2, sizeof(@typ@));\n+\t}\n+}\n+/**end repeat**/\n+\n+\n \n /*** isinf, isinf, isfinite, signbit ***/\n /**begin repeat\n",
                "added_lines": 31,
                "deleted_lines": 4,
                "source_code": "/* -*- c -*- */\n\n#include \"Python.h\"\n#include \"scipy/arrayobject.h\"\n#define _UMATHMODULE\n#include \"scipy/ufuncobject.h\"\n#include \"abstract.h\"\n#include <math.h>\n\n\n/* A whole slew of basic math functions are provided originally by Konrad Hinsen. */\n\n#if !defined(__STDC__) && !defined(_MSC_VER)\nextern double fmod (double, double);\nextern double frexp (double, int *);\nextern double ldexp (double, int);\nextern double modf (double, double *);\n#endif\n#ifndef M_PI\n#define M_PI 3.14159265358979323846264338328\n#endif\n\n#ifndef HAVE_INVERSE_HYPERBOLIC\nstatic double acosh(double x)\n{\n\treturn log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n\tdouble x;\n\tint sign;\n\tif (xx < 0.0) {\n\t\tsign = -1;\n\t\tx = -xx;\n\t}\n\telse {\n\t\tsign = 1;\n\t\tx = xx;\n\t}\n\treturn sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n\treturn 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#ifdef HAVE_HYPOT\n#if !defined(NeXT) && !defined(_MSC_VER)\nextern double hypot(double, double);\n#endif\n#else\ndouble hypot(double x, double y)\n{\n\tdouble yx;\n\n\tx = fabs(x);\n\ty = fabs(y);\n\tif (x < y) {\n\t\tdouble temp = x;\n\t\tx = y;\n\t\ty = temp;\n\t}\n\tif (x == 0.)\n\t\treturn 0.;\n\telse {\n\t\tyx = y/x;\n\t\treturn x*sqrt(1.+yx*yx);\n\t}\n}\n#endif\n\n\n\n/* Define isnan, isinf, isfinite, signbit if needed */\n/* Use fpclassify if possible */\n/* isnan, isinf --\n       these will use macros and then fpclassify if available before\n       defaulting to a dumb convert-to-double version...\n\n   isfinite -- define a macro if not already available\n   signbit -- if macro available use it, otherwise define a function\n               and a dumb convert-to-double version for other types.\n*/\n\n#if defined(fpclassify)\n\n#if !defined(isnan)\n#define isnan(x) (fpclassify(x) == FP_NAN)\n#endif\n#if !defined(isinf)\n#define isinf(x) (fpclassify(x) == FP_INFINITE)\n#endif\n\n#else  /* check to see if already have a function like this */\n\n#if !defined(HAVE_ISNAN)\n\n#if !defined(isnan)\n#include \"_isnan.c\"\n#endif\n\n#if !defined(isinf)\n#define isinf(x) (!isnan((x)) && isnan((x)-(x)))\n#endif\n\n#endif /* HAVE_ISNAN */\n#endif /* !defined(isnan) */\n\n\n/* Define signbit if needed */\n#if !defined(signbit)\n#include \"_signbit.c\"\n#endif\n\n\n/* Now defined the extended type macros */\n\n/* We assume that isnan and isinf are defined in the same \n   way:  as functions, with extended functions, or macros\n*/\n\n#if !defined(isnan)\n\n#if !defined(HAVE_LONGDOUBLE_FUNCS) || !defined(HAVE_ISNAN)\n#define isnanl(x) isnan((double)(x))\n#define isinfl(x) (!isnanl((x)) && isnanl((x)-(x)))\n#endif\n\n#if !defined(HAVE_FLOAT_FUNCS) || !defined(HAVE_ISNAN)\n#define isnanf(x) isnan((double)(x))\n#define isinff(x) (!isnanf((x)) && isnanf((x)-(x)))\n#endif\n\n#else /* !defined(isnan) */\n\n#define isnanl(x) isnan((x))\n#define isnanf(x) isnan((x))\n#define isinfl(x) isinf((x))\n#define isinff(x) isinf((x))\n\n#endif /* !defined(isnan) */\n\n\n\n#if !defined(signbit)\n#define signbitl(x) ((longdouble) signbit((double)(x)))\n#define signbitf(x) ((float) signbit((double) (x)))\n#else\n#define signbitl(x) signbit((x))\n#define signbitf(x) signbit((x))\n#endif\n\n#if !defined(isfinite)\n#define isfinite(x) (!(isinf((x)) || isnan((x))))\n#endif\n#define isfinitef(x) (!(isinff((x)) || isnanf((x))))\n#define isfinitel(x) (!(isinfl((x)) || isnanl((x))))\n\n\n/* First, the C functions that do the real work */\n\n/* if C99 extensions not availble\n\nthen define dummy functions that use the double versions for\n\nsin, cos, tan\nsinh, cosh, tanh, \nfabs, floor, ceil, fmod, sqrt, log10, log, exp, fabs\nasin, acos, atan, \nasinh, acosh, atanh\n\nhypot, atan2, pow\n\n*/\n\n/**begin repeat\n\n#kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,sqrt,log10,log,exp,asin,acos,atan,asinh,acosh,atanh)*2#\n#typ=longdouble*19, float*19#\n#c=l*19,f*19#\n#TYPE=LONGDOUBLE*19, FLOAT*19#\n*/\n#ifndef HAVE_@TYPE@_FUNCS\n@typ@ @kind@@c@(@typ@ x) {\n\treturn (@typ@) @kind@((double)x);\n}\n#endif\n/**end repeat**/\n\n/**begin repeat\n\n#kind=(atan2,hypot,pow,fmod)*2#\n#typ=longdouble*4, float*4#\n#c=l*4,f*4#\n#TYPE=LONGDOUBLE*4,FLOAT*4#\n*/\n#ifndef HAVE_@TYPE@_FUNCS\n@typ@ @kind@@c@(@typ@ x, @typ@ y) {\n\treturn (@typ@) @kind@((double)x, (double) y);\n}\n#endif\n/**end repeat**/\n\n/**begin repeat\n#kind=modf*2#\n#typ=longdouble, float#\n#c=l,f#\n#TYPE=LONGDOUBLE, FLOAT#\n*/\n#ifndef HAVE_@TYPE@_FUNCS\n@typ@ modf@c@(@typ@ x, @typ@ *iptr) {\n        double nx, niptr, y;\n        nx = (double) x;\n        y = modf(nx, &niptr);\n        *iptr = (@typ@) niptr;\n        return (@typ@) y;\n}\n#endif\n/**end repeat**/\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC_FLOAT)\n#ifdef HAVE_FLOAT_FUNCS\nstatic float acoshf(float x)\n{\n\treturn logf(x + sqrtf((x-1.0)*(x+1.0)));\n}\n\nstatic float asinhf(float xx)\n{\n\tfloat x;\n\tint sign;\n\tif (xx < 0.0) {\n\t\tsign = -1;\n\t\tx = -xx;\n\t}\n\telse {\n\t\tsign = 1;\n\t\tx = xx;\n\t}\n\treturn sign*logf(x + sqrtf(x*x+1.0));\n}\n\nstatic float atanhf(float x)\n{\n\treturn 0.5*logf((1.0+x)/(1.0-x));\n}\n#else\nstatic float acoshf(float x)\n{\n  return (float)acosh((double)(x));\n}\n\nstatic float asinhf(float x)\n{\n  return (float)asinh((double)(x));\n}\n\nstatic float atanhf(float x)\n{\n  return (float)atanh((double)(x));\n}\n#endif\n#endif\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE)\n#ifdef HAVE_LONGDOUBLE_FUNCS\nstatic longdouble acoshl(longdouble x)\n{\n\treturn logl(x + sqrtl((x-1.0)*(x+1.0)));\n}\n\nstatic longdouble asinhl(longdouble xx)\n{\n\tlongdouble x;\n\tint sign;\n\tif (xx < 0.0) {\n\t\tsign = -1;\n\t\tx = -xx;\n\t}\n\telse {\n\t\tsign = 1;\n\t\tx = xx;\n\t}\n\treturn sign*logl(x + sqrtl(x*x+1.0));\n}\n\nstatic longdouble atanhl(longdouble x)\n{\n\treturn 0.5*logl((1.0+x)/(1.0-x));\n}\n#else\nstatic longdouble acoshl(longdouble x)\n{\n  return (longdouble)acosh((double)(x));\n}\n\nstatic longdouble asinhl(longdouble x)\n{\n  return (longdouble)asinh((double)(x));\n}\n\nstatic longdouble atanhl(longdouble x)\n{\n  return (longdouble)atanh((double)(x));\n}\n#endif\n#endif\n\n\n\n\n/* Don't pass structures between functions (only pointers) because how\n   structures are passed is compiler dependent and could cause\n   segfaults if ufuncobject.c is compiled with a different compiler\n   than an extension that makes use of the UFUNC API\n*/\n\n/**begin repeat\n\n#typ=float, double, longdouble#\n#c=f,,l#\n*/\n\n/* constants */\nstatic c@typ@ nc_1@c@ = {1., 0.};\nstatic c@typ@ nc_half@c@ = {0.5, 0.};\nstatic c@typ@ nc_i@c@ = {0., 1.};\nstatic c@typ@ nc_i2@c@ = {0., 0.5};\n/*\nstatic c@typ@ nc_mi@c@ = {0., -1.};\nstatic c@typ@ nc_pi2@c@ = {M_PI/2., 0.};\n*/\n\nstatic void\nnc_sum@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\tr->real = a->real + b->real;\n\tr->imag = a->imag + b->imag;\n\treturn;\n}\n\nstatic void\nnc_diff@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\tr->real = a->real - b->real;\n\tr->imag = a->imag - b->imag;\n\treturn;\n}\n\nstatic void\nnc_neg@c@(c@typ@ *a, c@typ@ *r)\n{\n\tr->real = -a->real;\n\tr->imag = -a->imag;\n\treturn;\n}\n\nstatic void\nnc_prod@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;\n\tr->real = ar*br - ai*bi;\n\tr->imag = ar*bi + ai*br;\n\treturn;\n}\n\nstatic void\nnc_quot@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;    \n\t@typ@ d = br*br + bi*bi;\n\tr->real = (ar*br + ai*bi)/d;\n\tr->imag = (ai*br - ar*bi)/d;\n\treturn;\n}\n\nstatic void\nnc_floor_quot@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;    \n\t@typ@ d = br*br + bi*bi;\n\tr->real = floor@c@((ar*br + ai*bi)/d);\n\tr->imag = 0;\n\treturn;\n}\n\nstatic void \nnc_sqrt@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ s,d;\n\tif (x->real == 0. && x->imag == 0.)\n\t\t*r = *x;\n\telse {\n\t\ts = sqrt@c@(0.5*(fabs@c@(x->real) + hypot@c@(x->real,x->imag)));\n\t\td = 0.5*x->imag/s;\n\t\tif (x->real > 0.) {\n\t\t\tr->real = s;\n\t\t\tr->imag = d;\n\t\t}\n\t\telse if (x->imag >= 0.) {\n\t\t\tr->real = d;\n\t\t\tr->imag = s;\n\t\t}\n\t\telse {\n\t\t\tr->real = -d;\n\t\t\tr->imag = -s;\n\t\t}\n\t}\n\treturn;\n}\n\nstatic void \nnc_log@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ l = hypot@c@(x->real,x->imag);\n\tr->imag = atan2@c@(x->imag, x->real);\n\tr->real = log@c@(l);\n\treturn;\n}\n\nstatic void \nnc_exp@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ a = exp@c@(x->real);\n\tr->real = a*cos@c@(x->imag);\n\tr->imag = a*sin@c@(x->imag);\n\treturn;\n}\n\nstatic void\nnc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;\n\t\n\tif (br == 0. && bi == 0.) {\n\t\tr->real = 1.;\n\t\tr->imag = 0.;\n\t}\n\telse if (ar == 0. && ai == 0.) {\n\t\tr->real = 0.;\n\t\tr->imag = 0.;\n\t}\n\telse {\n\t\tnc_log@c@(a, r);\n\t\tnc_prod@c@(r, b, r);\n\t\tnc_exp@c@(r, r);\n\t}\n\treturn;\n}\n\n\nstatic void \nnc_prodi@c@(c@typ@ *x, c@typ@ *r)\n{\n\tr->real = -x->imag;\n\tr->imag = x->real;\n\treturn;\n}\n\n\nstatic void \nnc_acos@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_prod@c@(x,x,r);\n\tnc_diff@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_sum@c@(x, r, r);\n\tnc_log@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_neg@c@(r, r);\n\treturn;    \n\t/* return nc_neg(nc_prodi(nc_log(nc_sum(x,nc_prod(nc_i,\n\t   nc_sqrt(nc_diff(nc_1,nc_prod(x,x))))))));\n\t*/\n}\n\nstatic void \nnc_acosh@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_prod@c@(x, x, r);\n\tnc_diff@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_sum@c@(x, r, r);\n\tnc_log@c@(r, r);\n\treturn;\n\t/*\n\t  return nc_log(nc_sum(x,nc_prod(nc_i,\n\t  nc_sqrt(nc_diff(nc_1,nc_prod(x,x))))));\n\t*/\n}\n\nstatic void \nnc_asin@c@(c@typ@ *x, c@typ@ *r)\n{\n\tc@typ@ a, *pa=&a;\n\tnc_prod@c@(x, x, r);\n\tnc_diff@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_prodi@c@(x, pa);\n\tnc_sum@c@(pa, r, r);\n\tnc_log@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_neg@c@(r, r);\n\treturn;\n\t/*    \n\t      return nc_neg(nc_prodi(nc_log(nc_sum(nc_prod(nc_i,x),\n\t      nc_sqrt(nc_diff(nc_1,nc_prod(x,x)))))));\n\t*/\n}\n\n\nstatic void \nnc_asinh@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_prod@c@(x, x, r);\n\tnc_sum@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_diff@c@(r, x, r);\n\tnc_log@c@(r, r);\n\tnc_neg@c@(r, r);\n\treturn;\n\t/*\n\t  return nc_neg(nc_log(nc_diff(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x)));\n\t*/\n}\n\nstatic void \nnc_atan@c@(c@typ@ *x, c@typ@ *r)\n{\n\tc@typ@ a, *pa=&a;\n\tnc_diff@c@(&nc_i@c@, x, pa);\n\tnc_sum@c@(&nc_i@c@, x, r);\n\tnc_quot@c@(r, pa, r);\n\tnc_log@c@(r,r);\n\tnc_prod@c@(&nc_i2@c@, r, r);\n\treturn;\n\t/*\n\t  return nc_prod(nc_i2,nc_log(nc_quot(nc_sum(nc_i,x),nc_diff(nc_i,x))));\n\t*/\n}\n\nstatic void \nnc_atanh@c@(c@typ@ *x, c@typ@ *r)\n{\n\tc@typ@ a, *pa=&a;\n\tnc_diff@c@(&nc_1@c@, x, r);\n\tnc_sum@c@(&nc_1@c@, x, pa);\n\tnc_quot@c@(pa, r, r);\n\tnc_log@c@(r, r);\n\tnc_prod@c@(&nc_half@c@, r, r);\n\treturn;\n\t/*\n\t  return nc_prod(nc_half,nc_log(nc_quot(nc_sum(nc_1,x),nc_diff(nc_1,x))));\n\t*/\n}\n\nstatic void\nnc_cos@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;\n\tr->real = cos@c@(xr)*cosh@c@(xi);\n\tr->imag = -sin@c@(xr)*sinh@c@(xi);\n\treturn;\n}\n\nstatic void \nnc_cosh@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;\n\tr->real = cos(xi)*cosh(xr);\n\tr->imag = sin(xi)*sinh(xr);\n\treturn;\n}\n\n\n#define M_LOG10_E 0.434294481903251827651128918916605082294397\n\nstatic void \nnc_log10@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_log@c@(x, r);\n\tr->real *= M_LOG10_E;\n\tr->imag *= M_LOG10_E;\n\treturn;\n}\n\nstatic void \nnc_sin@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;\n\tr->real = sin@c@(xr)*cosh@c@(xi);\n\tr->imag = cos@c@(xr)*sinh@c@(xi);\n\treturn;\n}\n\nstatic void\nnc_sinh@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;    \n\tr->real = cos@c@(xi)*sinh@c@(xr);\n\tr->imag = sin@c@(xi)*cosh@c@(xr);\n\treturn;\n}\n\nstatic void \nnc_tan@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ sr,cr,shi,chi;\n\t@typ@ rs,is,rc,ic;\n\t@typ@ d;\n\t@typ@ xr=x->real, xi=x->imag;\n\tsr = sin@c@(xr);\n\tcr = cos@c@(xr);\n\tshi = sinh(xi);\n\tchi = cosh(xi);\n\trs = sr*chi;\n\tis = cr*shi;\n\trc = cr*chi;\n\tic = -sr*shi;\n\td = rc*rc + ic*ic;\n\tr->real = (rs*rc+is*ic)/d;\n\tr->imag = (is*rc-rs*ic)/d;\n\treturn;\n}\n\nstatic void \nnc_tanh@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ si,ci,shr,chr;\n\t@typ@ rs,is,rc,ic;\n\t@typ@ d;\n\t@typ@ xr=x->real, xi=x->imag;\n\tsi = sin@c@(xi);\n\tci = cos@c@(xi);\n\tshr = sinh@c@(xr);\n\tchr = cosh@c@(xr);\n\trs = ci*shr;\n\tis = si*chr;\n\trc = ci*chr;\n\tic = si*shr;\n\td = rc*rc + ic*ic;\n\tr->real = (rs*rc+is*ic)/d;\n\tr->imag = (is*rc-rs*ic)/d;\n\treturn;\n}\n\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(BOOL, BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#\n#OP=||, +*13, ^, -*13#\n#kind=add*14, subtract*14#\n#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#\n*/\n\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t}\n}\n\n/**end repeat**/\n\n/**begin repeat\n\n#TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*2#\n#OP=+*3,-*3#\n#kind=add*3,subtract*3#\n#typ=(float, double, longdouble)*2#\n\n*/\n\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t((@typ@ *)op)[0]=((@typ@ *)i1)[0] @OP@ ((@typ@ *)i2)[0]; \n\t\t((@typ@ *)op)[1]=((@typ@ *)i1)[1] @OP@ ((@typ@ *)i2)[1];\n\t}\n}\n\n/**end repeat**/\n\n\n/** Routines borrowed from numarray **/\n\n/* The following routine is used in the event of a detected integer *\n** divide by zero so that a floating divide by zero is generated.   *\n** This is done since Numeric uses the floating point exception    *\n** sticky bits to detect errors. The last bit is an attempt to      *\n** prevent optimization of the divide by zero away, the output value *\n** should always be 0                                               *\n*/\n\n/* These should really be altered to just set the corresponding bit\n   in the floating point status flag.  Need to figure out how to do that\n   on all the platforms...\n*/\n\nstatic int numeric_zero = 0.0;\n\n#if !defined(generate_divbyzero_error)\nstatic void generate_divbyzero_error(void) {\n\tdouble dummy;\n\tdummy = 1./numeric_zero;\n\treturn;\n}\n#endif\n\n#if !defined(generate_overflow_error)\nstatic double numeric_two = 2.0;\nstatic void generate_overflow_error(void) {\n\tdouble dummy;\n\tdummy = pow(numeric_two,1000);\n\treturn;\n}\n#endif\n\n\nstatic int ulonglong_overflow(ulonglong a, ulonglong b)\n{\n        ulonglong ah, al, bh, bl, w, x, y, z;\n\n#if SIZEOF_LONGLONG == 64\n\tah = (a >> 32);\n\tal = (a & 0xFFFFFFFFL);\n\tbh = (b >> 32);\n\tbl = (b & 0xFFFFFFFFL);\n#elif SIZEOF_LONGLONG == 128\n\tah = (a >> 64);\n\tal = (a & 0xFFFFFFFFFFFFFFFFL);\n\tbh = (b >> 64);\n\tbl = (b & 0xFFFFFFFFFFFFFFFFL);\n#else\n\tah = al = bh = bl = 0;\n#endif\n\n        /* 128-bit product:  z*2**64 + (x+y)*2**32 + w  */\n\tw = al*bl;\n\tx = bh*al;\n\ty = ah*bl;\n\tz = ah*bh;\n\n\t/* *c = ((x + y)<<32) + w; */\n#if SIZEOF_LONGLONG == 64\n\treturn z || (x>>32) || (y>>32) ||\n\t\t(((x & 0xFFFFFFFFL) + (y & 0xFFFFFFFFL) + (w >> 32)) >> 32);\n#elif SIZEOF_LONGLONG == 128\n\treturn z || (x>>64) || (y>>64) ||\n\t\t(((x & 0xFFFFFFFFFFFFFFFFL) + (y & 0xFFFFFFFFFFFFFFFFL) + (w >> 64)) >> 64);\n#else\n\treturn 0;\n#endif\n\t\n}\n\nstatic int slonglong_overflow(longlong a0, longlong b0)\n{\n\tulonglong a, b;\n        ulonglong ah, al, bh, bl, w, x, y, z;\n\n        /* Convert to non-negative quantities */\n\tif (a0 < 0) { a = -a0; } else { a = a0; }\n\tif (b0 < 0) { b = -b0; } else { b = b0; }\n\n\n#if SIZEOF_LONGLONG == 64\n\tah = (a >> 32);\n\tal = (a & 0xFFFFFFFFL);\n\tbh = (b >> 32);\n\tbl = (b & 0xFFFFFFFFL);\n#elif SIZEOF_LONGLONG == 128\n\tah = (a >> 64);\n\tal = (a & 0xFFFFFFFFFFFFFFFFL);\n\tbh = (b >> 64);\n\tbl = (b & 0xFFFFFFFFFFFFFFFFL);\n#else \n\tah = al = bh = bl = 0;\n#endif\n\n\tw = al*bl;\n\tx = bh*al;\n\ty = ah*bl;\n\tz = ah*bh;\n\n        /* \n\t   ulonglong c = ((x + y)<<32) + w;\n\t   if ((a0 < 0) ^ (b0 < 0))\n\t   *c = -c;\n\t   else \n\t   *c = c\n\t   */\n\n#if SIZEOF_LONGLONG == 64\n\treturn z || (x>>31) || (y>>31) ||\n\t\t(((x & 0xFFFFFFFFL) + (y & 0xFFFFFFFFL) + (w >> 32)) >> 31);\n#elif SIZEOF_LONGLONG == 128\n\treturn z || (x>>63) || (y>>63) ||\n\t\t(((x & 0xFFFFFFFFFFFFFFFFL) + (y & 0xFFFFFFFFFFFFFFFFL) + (w >> 64)) >> 63);\n#else\n\treturn 0;\n#endif\n}\n\n/** end direct numarray code **/\n\nstatic void\nBOOL_multiply(char **args, intp *dimensions, intp *steps, void *func) {\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op) = *((Bool *)i1) && *((Bool *)i2);\n\t}  \n}\n\n/**begin repeat\n\n#TYP= UBYTE,USHORT,UINT, ULONG#\n#typ= ubyte, ushort, uint, ulong#\n#bigtyp= int, int, double, double#\n*/\n\nstatic void \n@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@bigtyp@ temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = (@bigtyp@)(*((@typ@ *)i1)) * (@bigtyp@)(*((@typ@ *)i2));\n\t\tif (temp > MAX_@TYP@) \n\t\t\tgenerate_overflow_error();\n\t\t*((@typ@ *)op) = temp;\n\t}  \n}\n\n/**end repeat**/\n\nstatic void \nULONGLONG_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tulonglong temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = *((ulonglong *)i1) * *((ulonglong *)i2);\n\t\tif (ulonglong_overflow(*((ulonglong *)i1), *((ulonglong *)i2)))\n\t\t\tgenerate_overflow_error();\n\t\t*((ulonglong *)op) = temp;\n\t}  \n}\n\n/**begin repeat\n\n#TYP= BYTE,SHORT,INT, LONG#\n#typ= byte, short, int, long#\n#bigtyp= int, int, double, double#\n*/\n\nstatic void \n@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@bigtyp@ temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = (@bigtyp@)*((@typ@ *)i1) * (@bigtyp@)*((@typ@ *)i2);\n\t\tif (temp > MAX_@TYP@) \n\t\t\tgenerate_overflow_error();\n\t\telse if (temp < MIN_@TYP@) \n\t\t\tgenerate_overflow_error();\n\t\t*((@typ@ *)op) = temp;\n\t}  \n}\n\n/**end repeat**/\n\nstatic void \nLONGLONG_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tlonglong temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = *((longlong *)i1) * *((longlong *)i2);\n\t\tif (slonglong_overflow(*((longlong *)i1), *((longlong *)i2)))\n\t\t\tgenerate_overflow_error();\n\t\t*((longlong *)op) = temp;\n\t}  \n}\n\n\n/**begin repeat\n\n#TYP=FLOAT,DOUBLE,LONGDOUBLE#\n#typ=float,double,longdouble#\n*/\nstatic void \n@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t/* fprintf(stderr, \"Multiplying %d elements of type @typ@\\n\", n);\n\tfprintf(stderr, \"args= %p, %p, %p\\n\", i1, i2, op);\n\tfprintf(stderr, \"steps=%d, %d, %d\\n\", is1, is2, os); */\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) * *((@typ@ *)i2);\n\t}    \n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n#typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n#otyp=float*4, double*6#\n*/\nstatic void\n@TYP@_divide(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tif (*((@typ@ *)i2)==0) {\n\t\t\tgenerate_divbyzero_error();\n\t\t\t*((@typ@ *)op)=0;\n\t\t}\n\t\telse {\n\t\t\t*((@typ@ *)op)= *((@typ@ *)i1) / *((@typ@ *)i2);\n\t\t}\n\t}\n}\nstatic void\n@TYP@_true_divide(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tif (*((@typ@ *)i2)==0) {\n\t\t\tgenerate_divbyzero_error();\n\t\t\t*((@otyp@ *)op)=0;\n\t\t}\n\t\telse {\n\t\t\t*((@otyp@ *)op)=\t\t\t\t\\\n\t\t\t\t*((@typ@ *)i1) / (double)*((@typ@ *)i2);\n\t\t}\n\t}\n}\n#define @TYP@_floor_divide @TYP@_divide\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=(FLOAT,DOUBLE,LONGDOUBLE)*2#\n#typ=(float,double,longdouble)*2#\n#kind=divide*3, true_divide*3#\n*/\nstatic void \n@TYP@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) / *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=FLOAT,DOUBLE,LONGDOUBLE#\n#typ=float,double,longdouble#\n#c=f,,l#\n*/\nstatic void \n@TYP@_floor_divide(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=floor@c@(*((@typ@ *)i1) / *((@typ@ *)i2));\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n#typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n#btyp=float*4, double*6#\n*/\nstatic void \n@TYP@_power(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1];\n\tregister intp os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@btyp@ x, y, v;\n    @typ@ z;\n    \n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tx = *((@typ@ *)i1);\n\t\ty = *((@typ@ *)i2);\n\t\tz = (@typ@) y;\n\t\tif ((x < 0.0) && (y != z))  v = 1.0/numeric_zero;\n\t\telse v = pow(x,y);\n\t\t*((@typ@ *)op) = (@typ@) v;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=UBYTE, BYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE#\n#typ=ubyte, char, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@TYP@_conjugate(char **args, intp *dimensions, intp *steps, void *func)  \n{\n\tregister intp i, is1=steps[0], os=steps[1], n=dimensions[0]; \n\tchar *i1=args[0], *op=args[1]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#typ=float, double, longdouble#\n*/\nstatic void \n@TYP@_conjugate(char **args, intp *dimensions, intp *steps, void *func) {\n\tregister intp i, is1=steps[0], os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1]; \n\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t((@typ@ *)op)[0]=((@typ@ *)i1)[0]; \n\t\t((@typ@ *)op)[1]=-(((@typ@ *)i1)[1]);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=BOOL,UBYTE,USHORT,UINT,ULONG,ULONGLONG#\n#typ=Bool, ubyte, ushort, uint, ulong, ulonglong#\n*/\nstatic void \n@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, n;\n\tintp is1=steps[0], os=steps[1];\n\tchar *i1=args[0], *op=args[1];\n\n    n=dimensions[0];\n\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = *((@typ@*)i1);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYPE=BYTE,SHORT,INT,LONG,LONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=byte, short, int, long, longlong, float, double, longdouble#\n*/\nstatic void \n@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, n;\n\tintp is1=steps[0], os=steps[1];\n\tchar *i1=args[0], *op=args[1];\n\n\tn=dimensions[0]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = *((@typ@ *)i1) < 0 ? -*((@typ@ *)i1) : *((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n   #TYPE=CFLOAT,CDOUBLE,CLONGDOUBLE#\n   #typ= float, double, longdouble#\n   #c= f,,l#\n*/\nstatic void \n@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, n;\n\tregister intp is1=steps[0], os=steps[1]; \n\tchar *i1=args[0], *op=args[1]; \n\tn=dimensions[0];\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = (@typ@)sqrt@c@(((@typ@ *)i1)[0]*((@typ@ *)i1)[0] + ((@typ@ *)i1)[1]*((@typ@ *)i1)[1]);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#kind=greater, greater_equal, less, less_equal, equal, not_equal, logical_and, logical_or, bitwise_and, bitwise_or, bitwise_xor#\n#OP=>, >=, <, <=, ==, !=, &&, ||, &, |, ^#\n**/\nstatic void\nBOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tBool in1, in2;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tin1 = (*((Bool *)i1) != 0);\n\t\tin2 = (*((Bool *)i2) != 0);\n\t\t*((Bool *)op)= in1 @OP@ in2;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*4#\n#OP= >*16, >=*16, <*16, <=*16#\n#typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble)*4#\n#kind= greater*16, greater_equal*16, less*16, less_equal*16#\n*/\n\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*4#\n#typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*4#\n#OP= ==*13, !=*13, &&*13, ||*13#\n#kind=equal*13, not_equal*13, logical_and*13, logical_or*13#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op) = *((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*2#\n#typ=(float, double, longdouble)*2#\n#OP= ==*3, !=*3#\n#OP2= &&*3, ||*3#\n#kind=equal*3, not_equal*3#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op) = (*((@typ@ *)i1) @OP@ *((@typ@ *)i2)) @OP2@ (*((@typ@ *)i1+1) @OP@ *((@typ@ *)i2+1));\n\t}\n}\n/**end repeat**/\n\n\n/** OBJECT comparison for OBJECT arrays **/\n\n/**begin repeat\n\n#kind=greater, greater_equal, less, less_equal, equal, not_equal#\n#op=GT, GE, LT, LE, EQ, NE#\n*/\nstatic void\nOBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *func) {\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op)=PyObject_RichCompareBool(*((PyObject **)i1),\n\t\t\t\t\t\t       *((PyObject **)i2), \n\t\t\t\t\t\t       Py_@op@);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1];\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = - *((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1];\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((Bool *)op) = ! *((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n#define BOOL_negative BOOL_logical_not\n\n\n/**begin repeat\n#TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n#typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n#ftyp=float*4,double*4,longdouble*2#\n#c=f*4,,,,,l*2#\n*/\nstatic void\n@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@ftyp@ x, y, res;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tx = *((@typ@ *)i1);\n\t\ty = *((@typ@ *)i2);\n\t\tres = x - floor@c@(x/y)*y;\n\t\t*((@typ@ *)op)= (@typ@)(res);\n\t} \n}\n/**end repeat**/\n\n/**begin repeat\n#TYPE=FLOAT,DOUBLE,LONGDOUBLE#\n#typ=float,double,longdouble#\n#c=f,,l#\n*/\nstatic void\n@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@typ@ x, y, res;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tx = *((@typ@ *)i1);\n\t\ty = *((@typ@ *)i2);\n\t\tres = x - floor@c@(x/y)*y;\n\t\t*((@typ@ *)op)= res;\n\t} \n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG)*6#\n#typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong)*6#\n#OP= %*10, &*10, |*10, ^*10, <<*10, >>*10#\n#kind=fmod*10, bitwise_and*10, bitwise_or*10, bitwise_xor*10, left_shift*10, right_shift*10#\n\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t} \n}\n/**end repeat**/\n\n\n/**begin repeat\n   #TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n   #typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n*/\nstatic void \n@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = ~ *((@typ@*)i1);\n\t}\n}\n/**end repeat**/\n\nstatic void\nBOOL_invert(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((Bool *)op) = (*((Bool *)i1) ? FALSE : TRUE);\n\t}\n}\n\n\n/**begin repeat\n\n#TYPE=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n\n*/\nstatic void \n@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op)=(*((@typ@ *)i1) || *((@typ@ *)i2)) && !(*((@typ@ *)i1) && *((@typ@ *)i2));\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#\n#OP= >*14, <*14#\n#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#\n#kind= maximum*14, minimum*14#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2) ? *((@typ@ *)i1) : *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYPE=(CFLOAT,CDOUBLE,CLONGDOUBLE)*2#\n#OP= >*3, <*3#\n#typ=(cfloat, cdouble, clongdouble)*2#\n#kind= maximum*3, minimum*3#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n        @typ@ *i1c, *i2c;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n                i1c = (@typ@ *)i1;\n                i2c = (@typ@ *)i2;\n                if ((i1c->real @OP@ i2c->real) ||                       \\\n                    ((i1c->real==i2c->real) && (i1c->imag @OP@ i2c->imag)))\n                        memcpy(op, i1, sizeof(@typ@));\n                else\n                        memcpy(op, i2, sizeof(@typ@));\n\t}\n}\n/**end repeat**/\n\n\n\n/*** isinf, isinf, isfinite, signbit ***/\n/**begin repeat\n#kind=isnan*3, isinf*3, isfinite*3, signbit*3#\n#TYPE=(FLOAT, DOUBLE, LONGDOUBLE)*4#\n#typ=(float, double, longdouble)*4#\n#c=(f,,l)*4#\n*/\nstatic void\n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is=steps[0], os=steps[1], n=dimensions[0];\n        char *ip=args[0], *op=args[1];\n        for(i=0; i<n; i++, ip+=is, op+=os) {\n                *((Bool *)op) = @kind@@c@(*((@typ@ *)ip));\n        }\n}\n/**end repeat**/\n\n\n/**begin repeat\n#kind=isnan*3, isinf*3, isfinite*3#\n#TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*3#\n#typ=(float, double, longdouble)*3#\n#c=(f,,l)*3#\n#OP=||*6,&&*3#\n*/\nstatic void\n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is=steps[0], os=steps[1], n=dimensions[0];\n        char *ip=args[0], *op=args[1];\n        for(i=0; i<n; i++, ip+=is, op+=os) {\n                *((Bool *)op) = @kind@@c@(((@typ@ *)ip)[0]) @OP@        \\\n                        @kind@@c@(((@typ@ *)ip)[1]);\n        }\n}\n/**end repeat**/\n\n\n\n\n/****** modf ****/\n\n/**begin repeat\n#TYPE=FLOAT, DOUBLE, LONGDOUBLE#\n#typ=float, double, longdouble#\n#c=f,,l#\n*/\nstatic void\n@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is1=steps[0],os1=steps[1],os2=steps[2],n=dimensions[0];\n        char *i1=args[0], *op1=args[1], *op2=args[2];\n        @typ@ x1, y1, y2;\n        for (i=0; i<n; i++, i1+=is1, op1+=os1, op2+=os2) {\n                x1 = *((@typ@ *)i1);\n                y1 = modf@c@(x1, &y2);\n                *((@typ@ *)op1) = y1;\n                *((@typ@ *)op2) = y2;\n        }\n}\n/**end repeat**/\n\n#define HAVE_DOUBLE_FUNCS\n/**begin repeat\n#TYPE=FLOAT, DOUBLE, LONGDOUBLE#\n#typ=float, double, longdouble#\n#c=f,,l#\n*/\n#ifdef HAVE_@TYPE@_FUNCS\nstatic void\n@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is1=steps[0],os1=steps[1],os2=steps[2],n=dimensions[0];\n        char *i1=args[0], *op1=args[1], *op2=args[2];\n        @typ@ x1, y1;\n        int y2;\n        for (i=0; i<n; i++, i1+=is1, op1+=os1, op2+=os2) {\n                x1 = *((@typ@ *)i1);\n                y1 = frexp@c@(x1, &y2);\n                *((@typ@ *)op1) = y1;\n                *((int *) op2) = y2;\n        }\n}\n\nstatic void\n@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n        char *i1=args[0], *i2=args[1], *op=args[2];\n        @typ@ x1, y1;\n        int x2;\n        for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n                x1 = *((@typ@ *)i1);\n                x2 = *((int *)i2);\n                y1 = ldexp@c@(x1, x2);\n                *((@typ@ *)op) = y1;\n        }\n}\n#endif\n/**end repeat**/\n#undef HAVE_DOUBLE_FUNCS\n\n\nstatic PyUFuncGenericFunction frexp_functions[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        FLOAT_frexp,\n#endif\n        DOUBLE_frexp\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,LONGDOUBLE_frexp\n#endif\n};\n\nstatic void * blank3_data[] = { (void *)NULL, (void *)NULL, (void *)NULL};\nstatic char frexp_signatures[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        PyArray_FLOAT, PyArray_FLOAT, PyArray_INT,\n#endif\n        PyArray_DOUBLE, PyArray_DOUBLE, PyArray_INT\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,PyArray_LONGDOUBLE, PyArray_LONGDOUBLE, PyArray_INT\n#endif\n};\n\n\nstatic PyUFuncGenericFunction ldexp_functions[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        FLOAT_ldexp,\n#endif\n        DOUBLE_ldexp\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,LONGDOUBLE_ldexp\n#endif\n};\n\nstatic char ldexp_signatures[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        PyArray_FLOAT, PyArray_INT, PyArray_FLOAT,\n#endif\n        PyArray_DOUBLE, PyArray_INT, PyArray_DOUBLE\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,PyArray_LONGDOUBLE, PyArray_INT, PyArray_LONGDOUBLE\n#endif\n};\n\n\n\n#include \"__umath_generated.c\"\n\n\n#include \"ufuncobject.c\"\n\n#include \"__ufunc_api.c\"\n\nstatic double\npinf_init(void)\n{\n    double mul = 1e10;\n    double tmp = 0.0;\n    double pinf;\n\n    pinf = mul;\n    for (;;) {\n        pinf *= mul;\n        if (pinf == tmp) break;\n        tmp = pinf;\n    }\n    return pinf;\n}\n\nstatic double\npzero_init(void)\n{\n    double div = 1e10;\n    double tmp = 0.0;\n    double pinf;\n\n    pinf = div;\n    for (;;) {\n        pinf /= div;\n        if (pinf == tmp) break;\n        tmp = pinf;\n    }\n    return pinf;\n}\n\n/* Less automated additions to the ufuncs */\n\nstatic void\nInitOtherOperators(PyObject *dictionary) {\n        PyObject *f;\n        int num=1;\n     \n#ifdef HAVE_LONGDOUBLE_FUNCS\n        num += 1;\n#endif\n#ifdef HAVE_FLOAT_FUNCS\n        num += 1;\n#endif\n        f = PyUFunc_FromFuncAndData(frexp_functions, blank3_data, \n\t\t\t\t    frexp_signatures, num,\n                                    1, 2, PyUFunc_None, \"frexp\",\n                                    \"Split the number, x, into a normalized\"\\\n\t\t\t\t    \" fraction (y1) and exponent (y2)\",0);\n        PyDict_SetItemString(dictionary, \"frexp\", f);\n        Py_DECREF(f);\n\n        f = PyUFunc_FromFuncAndData(ldexp_functions, blank3_data, ldexp_signatures, num,\n                                    2, 1, PyUFunc_None, \"ldexp\",\n                                    \"Compute y = x1 * 2**x2.\",0);\n        PyDict_SetItemString(dictionary, \"ldexp\", f);\n        Py_DECREF(f);\n        return;\n}\n\n\nstatic struct PyMethodDef methods[] = {\n        {\"frompyfunc\", (PyCFunction) ufunc_frompyfunc,\n         METH_VARARGS | METH_KEYWORDS, doc_frompyfunc},\n\t{NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initumath(void) {\n\tPyObject *m, *d, *s, *s2, *c_api;\n\tdouble pinf, pzero, mynan;\n  \n\t/* Create the module and add the functions */\n\tm = Py_InitModule(\"umath\", methods); \n\n\t/* Import the array */\n\tif (import_array() < 0) return;\n\n\t/* Initialize the types */\n\tif (PyType_Ready(&PyUFunc_Type) < 0)\n                return;         \n\n\tif (PyType_Ready(&PyUFuncLoop_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyUFuncReduce_Type) < 0)\n                return; \n\n\n\t/* Add some symbolic constants to the module */\n\td = PyModule_GetDict(m);\n\n\tc_api = PyCObject_FromVoidPtr((void *)PyUFunc_API, NULL);\n\tif (PyErr_Occurred()) goto err;\n\tPyDict_SetItemString(d, \"_UFUNC_API\", c_api);\n\tPy_DECREF(c_api);\n\tif (PyErr_Occurred()) goto err;\n\n\ts = PyString_FromString(\"0.4.0\");\n\tPyDict_SetItemString(d, \"__version__\", s);\n\tPy_DECREF(s);\n\n\t/* Load the ufunc operators into the array module's namespace */\n\tInitOperators(d); \n\n        InitOtherOperators(d);\n\n\tPyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(M_PI));\n\tPy_DECREF(s);\n\tPyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n\tPy_DECREF(s);\n\n#define ADDCONST(str) PyModule_AddIntConstant(m, #str, UFUNC_##str)\n#define ADDSCONST(str) PyModule_AddStringConstant(m, \"UFUNC_\" #str, UFUNC_##str)\n\n        ADDCONST(ERR_IGNORE);\n        ADDCONST(ERR_WARN);\n        ADDCONST(ERR_CALL);\n        ADDCONST(ERR_RAISE);\n        ADDCONST(ERR_DEFAULT);\n\n        ADDCONST(SHIFT_DIVIDEBYZERO);\n        ADDCONST(SHIFT_OVERFLOW);\n        ADDCONST(SHIFT_UNDERFLOW);\n        ADDCONST(SHIFT_INVALID);\n                \n        ADDCONST(FPE_DIVIDEBYZERO);\n        ADDCONST(FPE_OVERFLOW);\n        ADDCONST(FPE_UNDERFLOW);\n        ADDCONST(FPE_INVALID);\n\n        ADDSCONST(ERRMASK_NAME);\n        ADDSCONST(ERRFUNC_NAME);\n        ADDSCONST(BUFSIZE_NAME);\n\n#undef ADDCONST\n#undef ADDSCONST\n        PyModule_AddIntConstant(m, \"UFUNC_BUFSIZE_DEFAULT\", (long)PyArray_BUFSIZE);\n        \n        pinf = pinf_init();\n        pzero = pzero_init();\n        mynan = pinf / pinf;\n\n        PyModule_AddObject(m, \"PINF\", PyFloat_FromDouble(pinf));\n        PyModule_AddObject(m, \"NINF\", PyFloat_FromDouble(-pinf));\n        PyModule_AddObject(m, \"PZERO\", PyFloat_FromDouble(pzero));\n        PyModule_AddObject(m, \"NZERO\", PyFloat_FromDouble(-pzero));\n        PyModule_AddObject(m, \"NAN\", PyFloat_FromDouble(mynan));\n\n\ts = PyDict_GetItemString(d, \"conjugate\");\n\ts2 = PyDict_GetItemString(d, \"remainder\");\n\t/* Setup the array object's numerical structures with appropriate \n\t   ufuncs in d*/\n\tPyArray_SetNumericOps(d);\n\n\tPyDict_SetItemString(d, \"conj\", s);\n\tPyDict_SetItemString(d, \"mod\", s2);\n\n err:  \n\t/* Check for errors */\n\tif (PyErr_Occurred())\n\t\tPy_FatalError(\"can't initialize module umath\");\n}\n",
                "source_code_before": "/* -*- c -*- */\n\n#include \"Python.h\"\n#include \"scipy/arrayobject.h\"\n#define _UMATHMODULE\n#include \"scipy/ufuncobject.h\"\n#include \"abstract.h\"\n#include <math.h>\n\n\n/* A whole slew of basic math functions are provided originally by Konrad Hinsen. */\n\n#if !defined(__STDC__) && !defined(_MSC_VER)\nextern double fmod (double, double);\nextern double frexp (double, int *);\nextern double ldexp (double, int);\nextern double modf (double, double *);\n#endif\n#ifndef M_PI\n#define M_PI 3.14159265358979323846264338328\n#endif\n\n#ifndef HAVE_INVERSE_HYPERBOLIC\nstatic double acosh(double x)\n{\n\treturn log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n\tdouble x;\n\tint sign;\n\tif (xx < 0.0) {\n\t\tsign = -1;\n\t\tx = -xx;\n\t}\n\telse {\n\t\tsign = 1;\n\t\tx = xx;\n\t}\n\treturn sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n\treturn 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#ifdef HAVE_HYPOT\n#if !defined(NeXT) && !defined(_MSC_VER)\nextern double hypot(double, double);\n#endif\n#else\ndouble hypot(double x, double y)\n{\n\tdouble yx;\n\n\tx = fabs(x);\n\ty = fabs(y);\n\tif (x < y) {\n\t\tdouble temp = x;\n\t\tx = y;\n\t\ty = temp;\n\t}\n\tif (x == 0.)\n\t\treturn 0.;\n\telse {\n\t\tyx = y/x;\n\t\treturn x*sqrt(1.+yx*yx);\n\t}\n}\n#endif\n\n\n\n/* Define isnan, isinf, isfinite, signbit if needed */\n/* Use fpclassify if possible */\n/* isnan, isinf --\n       these will use macros and then fpclassify if available before\n       defaulting to a dumb convert-to-double version...\n\n   isfinite -- define a macro if not already available\n   signbit -- if macro available use it, otherwise define a function\n               and a dumb convert-to-double version for other types.\n*/\n\n#if defined(fpclassify)\n\n#if !defined(isnan)\n#define isnan(x) (fpclassify(x) == FP_NAN)\n#endif\n#if !defined(isinf)\n#define isinf(x) (fpclassify(x) == FP_INFINITE)\n#endif\n\n#else  /* check to see if already have a function like this */\n\n#if !defined(HAVE_ISNAN)\n\n#if !defined(isnan)\n#include \"_isnan.c\"\n#endif\n\n#if !defined(isinf)\n#define isinf(x) (!isnan((x)) && isnan((x)-(x)))\n#endif\n\n#endif /* HAVE_ISNAN */\n#endif /* !defined(isnan) */\n\n\n/* Define signbit if needed */\n#if !defined(signbit)\n#include \"_signbit.c\"\n#endif\n\n\n/* Now defined the extended type macros */\n\n/* We assume that isnan and isinf are defined in the same \n   way:  as functions, with extended functions, or macros\n*/\n\n#if !defined(isnan)\n\n#if !defined(HAVE_LONGDOUBLE_FUNCS) || !defined(HAVE_ISNAN)\n#define isnanl(x) isnan((double)(x))\n#define isinfl(x) (!isnanl((x)) && isnanl((x)-(x)))\n#endif\n\n#if !defined(HAVE_FLOAT_FUNCS) || !defined(HAVE_ISNAN)\n#define isnanf(x) isnan((double)(x))\n#define isinff(x) (!isnanf((x)) && isnanf((x)-(x)))\n#endif\n\n#else /* !defined(isnan) */\n\n#define isnanl(x) isnan((x))\n#define isnanf(x) isnan((x))\n#define isinfl(x) isinf((x))\n#define isinff(x) isinf((x))\n\n#endif /* !defined(isnan) */\n\n\n\n#if !defined(signbit)\n#define signbitl(x) ((longdouble) signbit((double)(x)))\n#define signbitf(x) ((float) signbit((double) (x)))\n#else\n#define signbitl(x) signbit((x))\n#define signbitf(x) signbit((x))\n#endif\n\n#if !defined(isfinite)\n#define isfinite(x) (!(isinf((x)) || isnan((x))))\n#endif\n#define isfinitef(x) (!(isinff((x)) || isnanf((x))))\n#define isfinitel(x) (!(isinfl((x)) || isnanl((x))))\n\n\n/* First, the C functions that do the real work */\n\n/* if C99 extensions not availble\n\nthen define dummy functions that use the double versions for\n\nsin, cos, tan\nsinh, cosh, tanh, \nfabs, floor, ceil, fmod, sqrt, log10, log, exp, fabs\nasin, acos, atan, \nasinh, acosh, atanh\n\nhypot, atan2, pow\n\n*/\n\n/**begin repeat\n\n#kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,sqrt,log10,log,exp,asin,acos,atan,asinh,acosh,atanh)*2#\n#typ=longdouble*19, float*19#\n#c=l*19,f*19#\n#TYPE=LONGDOUBLE*19, FLOAT*19#\n*/\n#ifndef HAVE_@TYPE@_FUNCS\n@typ@ @kind@@c@(@typ@ x) {\n\treturn (@typ@) @kind@((double)x);\n}\n#endif\n/**end repeat**/\n\n/**begin repeat\n\n#kind=(atan2,hypot,pow,fmod)*2#\n#typ=longdouble*4, float*4#\n#c=l*4,f*4#\n#TYPE=LONGDOUBLE*4,FLOAT*4#\n*/\n#ifndef HAVE_@TYPE@_FUNCS\n@typ@ @kind@@c@(@typ@ x, @typ@ y) {\n\treturn (@typ@) @kind@((double)x, (double) y);\n}\n#endif\n/**end repeat**/\n\n/**begin repeat\n#kind=modf*2#\n#typ=longdouble, float#\n#c=l,f#\n#TYPE=LONGDOUBLE, FLOAT#\n*/\n#ifndef HAVE_@TYPE@_FUNCS\n@typ@ modf@c@(@typ@ x, @typ@ *iptr) {\n        double nx, niptr, y;\n        nx = (double) x;\n        y = modf(nx, &niptr);\n        *iptr = (@typ@) niptr;\n        return (@typ@) y;\n}\n#endif\n/**end repeat**/\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC_FLOAT)\n#ifdef HAVE_FLOAT_FUNCS\nstatic float acoshf(float x)\n{\n\treturn logf(x + sqrtf((x-1.0)*(x+1.0)));\n}\n\nstatic float asinhf(float xx)\n{\n\tfloat x;\n\tint sign;\n\tif (xx < 0.0) {\n\t\tsign = -1;\n\t\tx = -xx;\n\t}\n\telse {\n\t\tsign = 1;\n\t\tx = xx;\n\t}\n\treturn sign*logf(x + sqrtf(x*x+1.0));\n}\n\nstatic float atanhf(float x)\n{\n\treturn 0.5*logf((1.0+x)/(1.0-x));\n}\n#else\nstatic float acoshf(float x)\n{\n  return (float)acosh((double)(x));\n}\n\nstatic float asinhf(float x)\n{\n  return (float)asinh((double)(x));\n}\n\nstatic float atanhf(float x)\n{\n  return (float)atanh((double)(x));\n}\n#endif\n#endif\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE)\n#ifdef HAVE_LONGDOUBLE_FUNCS\nstatic longdouble acoshl(longdouble x)\n{\n\treturn logl(x + sqrtl((x-1.0)*(x+1.0)));\n}\n\nstatic longdouble asinhl(longdouble xx)\n{\n\tlongdouble x;\n\tint sign;\n\tif (xx < 0.0) {\n\t\tsign = -1;\n\t\tx = -xx;\n\t}\n\telse {\n\t\tsign = 1;\n\t\tx = xx;\n\t}\n\treturn sign*logl(x + sqrtl(x*x+1.0));\n}\n\nstatic longdouble atanhl(longdouble x)\n{\n\treturn 0.5*logl((1.0+x)/(1.0-x));\n}\n#else\nstatic longdouble acoshl(longdouble x)\n{\n  return (longdouble)acosh((double)(x));\n}\n\nstatic longdouble asinhl(longdouble x)\n{\n  return (longdouble)asinh((double)(x));\n}\n\nstatic longdouble atanhl(longdouble x)\n{\n  return (longdouble)atanh((double)(x));\n}\n#endif\n#endif\n\n\n\n\n/* Don't pass structures between functions (only pointers) because how\n   structures are passed is compiler dependent and could cause\n   segfaults if ufuncobject.c is compiled with a different compiler\n   than an extension that makes use of the UFUNC API\n*/\n\n/**begin repeat\n\n#typ=float, double, longdouble#\n#c=f,,l#\n*/\n\n/* constants */\nstatic c@typ@ nc_1@c@ = {1., 0.};\nstatic c@typ@ nc_half@c@ = {0.5, 0.};\nstatic c@typ@ nc_i@c@ = {0., 1.};\nstatic c@typ@ nc_i2@c@ = {0., 0.5};\n/*\nstatic c@typ@ nc_mi@c@ = {0., -1.};\nstatic c@typ@ nc_pi2@c@ = {M_PI/2., 0.};\n*/\n\nstatic void\nnc_sum@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\tr->real = a->real + b->real;\n\tr->imag = a->imag + b->imag;\n\treturn;\n}\n\nstatic void\nnc_diff@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\tr->real = a->real - b->real;\n\tr->imag = a->imag - b->imag;\n\treturn;\n}\n\nstatic void\nnc_neg@c@(c@typ@ *a, c@typ@ *r)\n{\n\tr->real = -a->real;\n\tr->imag = -a->imag;\n\treturn;\n}\n\nstatic void\nnc_prod@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;\n\tr->real = ar*br - ai*bi;\n\tr->imag = ar*bi + ai*br;\n\treturn;\n}\n\nstatic void\nnc_quot@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;    \n\t@typ@ d = br*br + bi*bi;\n\tr->real = (ar*br + ai*bi)/d;\n\tr->imag = (ai*br - ar*bi)/d;\n\treturn;\n}\n\nstatic void\nnc_floor_quot@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;    \n\t@typ@ d = br*br + bi*bi;\n\tr->real = floor@c@((ar*br + ai*bi)/d);\n\tr->imag = 0;\n\treturn;\n}\n\nstatic void \nnc_sqrt@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ s,d;\n\tif (x->real == 0. && x->imag == 0.)\n\t\t*r = *x;\n\telse {\n\t\ts = sqrt@c@(0.5*(fabs@c@(x->real) + hypot@c@(x->real,x->imag)));\n\t\td = 0.5*x->imag/s;\n\t\tif (x->real > 0.) {\n\t\t\tr->real = s;\n\t\t\tr->imag = d;\n\t\t}\n\t\telse if (x->imag >= 0.) {\n\t\t\tr->real = d;\n\t\t\tr->imag = s;\n\t\t}\n\t\telse {\n\t\t\tr->real = -d;\n\t\t\tr->imag = -s;\n\t\t}\n\t}\n\treturn;\n}\n\nstatic void \nnc_log@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ l = hypot@c@(x->real,x->imag);\n\tr->imag = atan2@c@(x->imag, x->real);\n\tr->real = log@c@(l);\n\treturn;\n}\n\nstatic void \nnc_exp@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ a = exp@c@(x->real);\n\tr->real = a*cos@c@(x->imag);\n\tr->imag = a*sin@c@(x->imag);\n\treturn;\n}\n\nstatic void\nnc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)\n{\n\t@typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;\n\t\n\tif (br == 0. && bi == 0.) {\n\t\tr->real = 1.;\n\t\tr->imag = 0.;\n\t}\n\telse if (ar == 0. && ai == 0.) {\n\t\tr->real = 0.;\n\t\tr->imag = 0.;\n\t}\n\telse {\n\t\tnc_log@c@(a, r);\n\t\tnc_prod@c@(r, b, r);\n\t\tnc_exp@c@(r, r);\n\t}\n\treturn;\n}\n\n\nstatic void \nnc_prodi@c@(c@typ@ *x, c@typ@ *r)\n{\n\tr->real = -x->imag;\n\tr->imag = x->real;\n\treturn;\n}\n\n\nstatic void \nnc_acos@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_prod@c@(x,x,r);\n\tnc_diff@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_sum@c@(x, r, r);\n\tnc_log@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_neg@c@(r, r);\n\treturn;    \n\t/* return nc_neg(nc_prodi(nc_log(nc_sum(x,nc_prod(nc_i,\n\t   nc_sqrt(nc_diff(nc_1,nc_prod(x,x))))))));\n\t*/\n}\n\nstatic void \nnc_acosh@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_prod@c@(x, x, r);\n\tnc_diff@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_sum@c@(x, r, r);\n\tnc_log@c@(r, r);\n\treturn;\n\t/*\n\t  return nc_log(nc_sum(x,nc_prod(nc_i,\n\t  nc_sqrt(nc_diff(nc_1,nc_prod(x,x))))));\n\t*/\n}\n\nstatic void \nnc_asin@c@(c@typ@ *x, c@typ@ *r)\n{\n\tc@typ@ a, *pa=&a;\n\tnc_prod@c@(x, x, r);\n\tnc_diff@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_prodi@c@(x, pa);\n\tnc_sum@c@(pa, r, r);\n\tnc_log@c@(r, r);\n\tnc_prodi@c@(r, r);\n\tnc_neg@c@(r, r);\n\treturn;\n\t/*    \n\t      return nc_neg(nc_prodi(nc_log(nc_sum(nc_prod(nc_i,x),\n\t      nc_sqrt(nc_diff(nc_1,nc_prod(x,x)))))));\n\t*/\n}\n\n\nstatic void \nnc_asinh@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_prod@c@(x, x, r);\n\tnc_sum@c@(&nc_1@c@, r, r);\n\tnc_sqrt@c@(r, r);\n\tnc_diff@c@(r, x, r);\n\tnc_log@c@(r, r);\n\tnc_neg@c@(r, r);\n\treturn;\n\t/*\n\t  return nc_neg(nc_log(nc_diff(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x)));\n\t*/\n}\n\nstatic void \nnc_atan@c@(c@typ@ *x, c@typ@ *r)\n{\n\tc@typ@ a, *pa=&a;\n\tnc_diff@c@(&nc_i@c@, x, pa);\n\tnc_sum@c@(&nc_i@c@, x, r);\n\tnc_quot@c@(r, pa, r);\n\tnc_log@c@(r,r);\n\tnc_prod@c@(&nc_i2@c@, r, r);\n\treturn;\n\t/*\n\t  return nc_prod(nc_i2,nc_log(nc_quot(nc_sum(nc_i,x),nc_diff(nc_i,x))));\n\t*/\n}\n\nstatic void \nnc_atanh@c@(c@typ@ *x, c@typ@ *r)\n{\n\tc@typ@ a, *pa=&a;\n\tnc_diff@c@(&nc_1@c@, x, r);\n\tnc_sum@c@(&nc_1@c@, x, pa);\n\tnc_quot@c@(pa, r, r);\n\tnc_log@c@(r, r);\n\tnc_prod@c@(&nc_half@c@, r, r);\n\treturn;\n\t/*\n\t  return nc_prod(nc_half,nc_log(nc_quot(nc_sum(nc_1,x),nc_diff(nc_1,x))));\n\t*/\n}\n\nstatic void\nnc_cos@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;\n\tr->real = cos@c@(xr)*cosh@c@(xi);\n\tr->imag = -sin@c@(xr)*sinh@c@(xi);\n\treturn;\n}\n\nstatic void \nnc_cosh@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;\n\tr->real = cos(xi)*cosh(xr);\n\tr->imag = sin(xi)*sinh(xr);\n\treturn;\n}\n\n\n#define M_LOG10_E 0.434294481903251827651128918916605082294397\n\nstatic void \nnc_log10@c@(c@typ@ *x, c@typ@ *r)\n{\n\tnc_log@c@(x, r);\n\tr->real *= M_LOG10_E;\n\tr->imag *= M_LOG10_E;\n\treturn;\n}\n\nstatic void \nnc_sin@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;\n\tr->real = sin@c@(xr)*cosh@c@(xi);\n\tr->imag = cos@c@(xr)*sinh@c@(xi);\n\treturn;\n}\n\nstatic void\nnc_sinh@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ xr=x->real, xi=x->imag;    \n\tr->real = cos@c@(xi)*sinh@c@(xr);\n\tr->imag = sin@c@(xi)*cosh@c@(xr);\n\treturn;\n}\n\nstatic void \nnc_tan@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ sr,cr,shi,chi;\n\t@typ@ rs,is,rc,ic;\n\t@typ@ d;\n\t@typ@ xr=x->real, xi=x->imag;\n\tsr = sin@c@(xr);\n\tcr = cos@c@(xr);\n\tshi = sinh(xi);\n\tchi = cosh(xi);\n\trs = sr*chi;\n\tis = cr*shi;\n\trc = cr*chi;\n\tic = -sr*shi;\n\td = rc*rc + ic*ic;\n\tr->real = (rs*rc+is*ic)/d;\n\tr->imag = (is*rc-rs*ic)/d;\n\treturn;\n}\n\nstatic void \nnc_tanh@c@(c@typ@ *x, c@typ@ *r)\n{\n\t@typ@ si,ci,shr,chr;\n\t@typ@ rs,is,rc,ic;\n\t@typ@ d;\n\t@typ@ xr=x->real, xi=x->imag;\n\tsi = sin@c@(xi);\n\tci = cos@c@(xi);\n\tshr = sinh@c@(xr);\n\tchr = cosh@c@(xr);\n\trs = ci*shr;\n\tis = si*chr;\n\trc = ci*chr;\n\tic = si*shr;\n\td = rc*rc + ic*ic;\n\tr->real = (rs*rc+is*ic)/d;\n\tr->imag = (is*rc-rs*ic)/d;\n\treturn;\n}\n\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(BOOL, BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#\n#OP=||, +*13, ^, -*13#\n#kind=add*14, subtract*14#\n#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#\n*/\n\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t}\n}\n\n/**end repeat**/\n\n/**begin repeat\n\n#TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*2#\n#OP=+*3,-*3#\n#kind=add*3,subtract*3#\n#typ=(float, double, longdouble)*2#\n\n*/\n\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t((@typ@ *)op)[0]=((@typ@ *)i1)[0] @OP@ ((@typ@ *)i2)[0]; \n\t\t((@typ@ *)op)[1]=((@typ@ *)i1)[1] @OP@ ((@typ@ *)i2)[1];\n\t}\n}\n\n/**end repeat**/\n\n\n/** Routines borrowed from numarray **/\n\n/* The following routine is used in the event of a detected integer *\n** divide by zero so that a floating divide by zero is generated.   *\n** This is done since Numeric uses the floating point exception    *\n** sticky bits to detect errors. The last bit is an attempt to      *\n** prevent optimization of the divide by zero away, the output value *\n** should always be 0                                               *\n*/\n\n/* These should really be altered to just set the corresponding bit\n   in the floating point status flag.  Need to figure out how to do that\n   on all the platforms...\n*/\n\nstatic int numeric_zero = 0.0;\n\n#if !defined(generate_divbyzero_error)\nstatic void generate_divbyzero_error(void) {\n\tdouble dummy;\n\tdummy = 1./numeric_zero;\n\treturn;\n}\n#endif\n\n#if !defined(generate_overflow_error)\nstatic double numeric_two = 2.0;\nstatic void generate_overflow_error(void) {\n\tdouble dummy;\n\tdummy = pow(numeric_two,1000);\n\treturn;\n}\n#endif\n\n\nstatic int ulonglong_overflow(ulonglong a, ulonglong b)\n{\n        ulonglong ah, al, bh, bl, w, x, y, z;\n\n#if SIZEOF_LONGLONG == 64\n\tah = (a >> 32);\n\tal = (a & 0xFFFFFFFFL);\n\tbh = (b >> 32);\n\tbl = (b & 0xFFFFFFFFL);\n#elif SIZEOF_LONGLONG == 128\n\tah = (a >> 64);\n\tal = (a & 0xFFFFFFFFFFFFFFFFL);\n\tbh = (b >> 64);\n\tbl = (b & 0xFFFFFFFFFFFFFFFFL);\n#else\n\tah = al = bh = bl = 0;\n#endif\n\n        /* 128-bit product:  z*2**64 + (x+y)*2**32 + w  */\n\tw = al*bl;\n\tx = bh*al;\n\ty = ah*bl;\n\tz = ah*bh;\n\n\t/* *c = ((x + y)<<32) + w; */\n#if SIZEOF_LONGLONG == 64\n\treturn z || (x>>32) || (y>>32) ||\n\t\t(((x & 0xFFFFFFFFL) + (y & 0xFFFFFFFFL) + (w >> 32)) >> 32);\n#elif SIZEOF_LONGLONG == 128\n\treturn z || (x>>64) || (y>>64) ||\n\t\t(((x & 0xFFFFFFFFFFFFFFFFL) + (y & 0xFFFFFFFFFFFFFFFFL) + (w >> 64)) >> 64);\n#else\n\treturn 0;\n#endif\n\t\n}\n\nstatic int slonglong_overflow(longlong a0, longlong b0)\n{\n\tulonglong a, b;\n        ulonglong ah, al, bh, bl, w, x, y, z;\n\n        /* Convert to non-negative quantities */\n\tif (a0 < 0) { a = -a0; } else { a = a0; }\n\tif (b0 < 0) { b = -b0; } else { b = b0; }\n\n\n#if SIZEOF_LONGLONG == 64\n\tah = (a >> 32);\n\tal = (a & 0xFFFFFFFFL);\n\tbh = (b >> 32);\n\tbl = (b & 0xFFFFFFFFL);\n#elif SIZEOF_LONGLONG == 128\n\tah = (a >> 64);\n\tal = (a & 0xFFFFFFFFFFFFFFFFL);\n\tbh = (b >> 64);\n\tbl = (b & 0xFFFFFFFFFFFFFFFFL);\n#else \n\tah = al = bh = bl = 0;\n#endif\n\n\tw = al*bl;\n\tx = bh*al;\n\ty = ah*bl;\n\tz = ah*bh;\n\n        /* \n\t   ulonglong c = ((x + y)<<32) + w;\n\t   if ((a0 < 0) ^ (b0 < 0))\n\t   *c = -c;\n\t   else \n\t   *c = c\n\t   */\n\n#if SIZEOF_LONGLONG == 64\n\treturn z || (x>>31) || (y>>31) ||\n\t\t(((x & 0xFFFFFFFFL) + (y & 0xFFFFFFFFL) + (w >> 32)) >> 31);\n#elif SIZEOF_LONGLONG == 128\n\treturn z || (x>>63) || (y>>63) ||\n\t\t(((x & 0xFFFFFFFFFFFFFFFFL) + (y & 0xFFFFFFFFFFFFFFFFL) + (w >> 64)) >> 63);\n#else\n\treturn 0;\n#endif\n}\n\n/** end direct numarray code **/\n\nstatic void\nBOOL_multiply(char **args, intp *dimensions, intp *steps, void *func) {\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op) = *((Bool *)i1) && *((Bool *)i2);\n\t}  \n}\n\n/**begin repeat\n\n#TYP= UBYTE,USHORT,UINT, ULONG#\n#typ= ubyte, ushort, uint, ulong#\n#bigtyp= int, int, double, double#\n*/\n\nstatic void \n@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@bigtyp@ temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = (@bigtyp@)(*((@typ@ *)i1)) * (@bigtyp@)(*((@typ@ *)i2));\n\t\tif (temp > MAX_@TYP@) \n\t\t\tgenerate_overflow_error();\n\t\t*((@typ@ *)op) = temp;\n\t}  \n}\n\n/**end repeat**/\n\nstatic void \nULONGLONG_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tulonglong temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = *((ulonglong *)i1) * *((ulonglong *)i2);\n\t\tif (ulonglong_overflow(*((ulonglong *)i1), *((ulonglong *)i2)))\n\t\t\tgenerate_overflow_error();\n\t\t*((ulonglong *)op) = temp;\n\t}  \n}\n\n/**begin repeat\n\n#TYP= BYTE,SHORT,INT, LONG#\n#typ= byte, short, int, long#\n#bigtyp= int, int, double, double#\n*/\n\nstatic void \n@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@bigtyp@ temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = (@bigtyp@)*((@typ@ *)i1) * (@bigtyp@)*((@typ@ *)i2);\n\t\tif (temp > MAX_@TYP@) \n\t\t\tgenerate_overflow_error();\n\t\telse if (temp < MIN_@TYP@) \n\t\t\tgenerate_overflow_error();\n\t\t*((@typ@ *)op) = temp;\n\t}  \n}\n\n/**end repeat**/\n\nstatic void \nLONGLONG_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], is2=steps[1], os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tlonglong temp;\n\tfor (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\ttemp = *((longlong *)i1) * *((longlong *)i2);\n\t\tif (slonglong_overflow(*((longlong *)i1), *((longlong *)i2)))\n\t\t\tgenerate_overflow_error();\n\t\t*((longlong *)op) = temp;\n\t}  \n}\n\n\n/**begin repeat\n\n#TYP=FLOAT,DOUBLE,LONGDOUBLE#\n#typ=float,double,longdouble#\n*/\nstatic void \n@TYP@_multiply(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t/* fprintf(stderr, \"Multiplying %d elements of type @typ@\\n\", n);\n\tfprintf(stderr, \"args= %p, %p, %p\\n\", i1, i2, op);\n\tfprintf(stderr, \"steps=%d, %d, %d\\n\", is1, is2, os); */\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) * *((@typ@ *)i2);\n\t}    \n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n#typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n#otyp=float*4, double*6#\n*/\nstatic void\n@TYP@_divide(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tif (*((@typ@ *)i2)==0) {\n\t\t\tgenerate_divbyzero_error();\n\t\t\t*((@typ@ *)op)=0;\n\t\t}\n\t\telse {\n\t\t\t*((@typ@ *)op)= *((@typ@ *)i1) / *((@typ@ *)i2);\n\t\t}\n\t}\n}\nstatic void\n@TYP@_true_divide(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tif (*((@typ@ *)i2)==0) {\n\t\t\tgenerate_divbyzero_error();\n\t\t\t*((@otyp@ *)op)=0;\n\t\t}\n\t\telse {\n\t\t\t*((@otyp@ *)op)=\t\t\t\t\\\n\t\t\t\t*((@typ@ *)i1) / (double)*((@typ@ *)i2);\n\t\t}\n\t}\n}\n#define @TYP@_floor_divide @TYP@_divide\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=(FLOAT,DOUBLE,LONGDOUBLE)*2#\n#typ=(float,double,longdouble)*2#\n#kind=divide*3, true_divide*3#\n*/\nstatic void \n@TYP@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) / *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=FLOAT,DOUBLE,LONGDOUBLE#\n#typ=float,double,longdouble#\n#c=f,,l#\n*/\nstatic void \n@TYP@_floor_divide(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=floor@c@(*((@typ@ *)i1) / *((@typ@ *)i2));\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYP=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n#typ=char, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n#btyp=float*4, double*6#\n*/\nstatic void \n@TYP@_power(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, is1=steps[0],is2=steps[1];\n\tregister intp os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@btyp@ x, y, v;\n    @typ@ z;\n    \n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tx = *((@typ@ *)i1);\n\t\ty = *((@typ@ *)i2);\n\t\tz = (@typ@) y;\n\t\tif ((x < 0.0) && (y != z))  v = 1.0/numeric_zero;\n\t\telse v = pow(x,y);\n\t\t*((@typ@ *)op) = (@typ@) v;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=UBYTE, BYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE#\n#typ=ubyte, char, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@TYP@_conjugate(char **args, intp *dimensions, intp *steps, void *func)  \n{\n\tregister intp i, is1=steps[0], os=steps[1], n=dimensions[0]; \n\tchar *i1=args[0], *op=args[1]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYP=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#typ=float, double, longdouble#\n*/\nstatic void \n@TYP@_conjugate(char **args, intp *dimensions, intp *steps, void *func) {\n\tregister intp i, is1=steps[0], os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1]; \n\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t((@typ@ *)op)[0]=((@typ@ *)i1)[0]; \n\t\t((@typ@ *)op)[1]=-(((@typ@ *)i1)[1]);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=BOOL,UBYTE,USHORT,UINT,ULONG,ULONGLONG#\n#typ=Bool, ubyte, ushort, uint, ulong, ulonglong#\n*/\nstatic void \n@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, n;\n\tintp is1=steps[0], os=steps[1];\n\tchar *i1=args[0], *op=args[1];\n\n    n=dimensions[0];\n\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = *((@typ@*)i1);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYPE=BYTE,SHORT,INT,LONG,LONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=byte, short, int, long, longlong, float, double, longdouble#\n*/\nstatic void \n@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, n;\n\tintp is1=steps[0], os=steps[1];\n\tchar *i1=args[0], *op=args[1];\n\n\tn=dimensions[0]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = *((@typ@ *)i1) < 0 ? -*((@typ@ *)i1) : *((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n   #TYPE=CFLOAT,CDOUBLE,CLONGDOUBLE#\n   #typ= float, double, longdouble#\n   #c= f,,l#\n*/\nstatic void \n@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i, n;\n\tregister intp is1=steps[0], os=steps[1]; \n\tchar *i1=args[0], *op=args[1]; \n\tn=dimensions[0];\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = (@typ@)sqrt@c@(((@typ@ *)i1)[0]*((@typ@ *)i1)[0] + ((@typ@ *)i1)[1]*((@typ@ *)i1)[1]);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#kind=greater, greater_equal, less, less_equal, equal, not_equal, logical_and, logical_or, bitwise_and, bitwise_or, bitwise_xor#\n#OP=>, >=, <, <=, ==, !=, &&, ||, &, |, ^#\n**/\nstatic void\nBOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tBool in1, in2;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tin1 = (*((Bool *)i1) != 0);\n\t\tin2 = (*((Bool *)i2) != 0);\n\t\t*((Bool *)op)= in1 @OP@ in2;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*4#\n#OP= >*16, >=*16, <*16, <=*16#\n#typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble)*4#\n#kind= greater*16, greater_equal*16, less*16, less_equal*16#\n*/\n\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*4#\n#typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*4#\n#OP= ==*13, !=*13, &&*13, ||*13#\n#kind=equal*13, not_equal*13, logical_and*13, logical_or*13#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op) = *((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*2#\n#typ=(float, double, longdouble)*2#\n#OP= ==*3, !=*3#\n#OP2= &&*3, ||*3#\n#kind=equal*3, not_equal*3#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op) = (*((@typ@ *)i1) @OP@ *((@typ@ *)i2)) @OP2@ (*((@typ@ *)i1+1) @OP@ *((@typ@ *)i2+1));\n\t}\n}\n/**end repeat**/\n\n\n/** OBJECT comparison for OBJECT arrays **/\n\n/**begin repeat\n\n#kind=greater, greater_equal, less, less_equal, equal, not_equal#\n#op=GT, GE, LT, LE, EQ, NE#\n*/\nstatic void\nOBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *func) {\n\tregister intp i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op)=PyObject_RichCompareBool(*((PyObject **)i1),\n\t\t\t\t\t\t       *((PyObject **)i2), \n\t\t\t\t\t\t       Py_@op@);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1];\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = - *((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1];\n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((Bool *)op) = ! *((@typ@ *)i1);\n\t}\n}\n/**end repeat**/\n\n#define BOOL_negative BOOL_logical_not\n\n\n/**begin repeat\n#TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n#typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n#ftyp=float*4,double*4,longdouble*2#\n#c=f*4,,,,,l*2#\n*/\nstatic void\n@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@ftyp@ x, y, res;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tx = *((@typ@ *)i1);\n\t\ty = *((@typ@ *)i2);\n\t\tres = x - floor@c@(x/y)*y;\n\t\t*((@typ@ *)op)= (@typ@)(res);\n\t} \n}\n/**end repeat**/\n\n/**begin repeat\n#TYPE=FLOAT,DOUBLE,LONGDOUBLE#\n#typ=float,double,longdouble#\n#c=f,,l#\n*/\nstatic void\n@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\t@typ@ x, y, res;\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\tx = *((@typ@ *)i1);\n\t\ty = *((@typ@ *)i2);\n\t\tres = x - floor@c@(x/y)*y;\n\t\t*((@typ@ *)op)= res;\n\t} \n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#TYPE=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG)*6#\n#typ=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong)*6#\n#OP= %*10, &*10, |*10, ^*10, <<*10, >>*10#\n#kind=fmod*10, bitwise_and*10, bitwise_or*10, bitwise_xor*10, left_shift*10, right_shift*10#\n\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2);\n\t} \n}\n/**end repeat**/\n\n\n/**begin repeat\n   #TYPE=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG#\n   #typ=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#\n*/\nstatic void \n@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((@typ@ *)op) = ~ *((@typ@*)i1);\n\t}\n}\n/**end repeat**/\n\nstatic void\nBOOL_invert(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0], os=steps[1], n=dimensions[0];\n\tchar *i1=args[0], *op=args[1]; \n\tfor(i=0; i<n; i++, i1+=is1, op+=os) {\n\t\t*((Bool *)op) = (*((Bool *)i1) ? FALSE : TRUE);\n\t}\n}\n\n\n/**begin repeat\n\n#TYPE=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#typ=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n\n*/\nstatic void \n@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((Bool *)op)=(*((@typ@ *)i1) || *((@typ@ *)i2)) && !(*((@typ@ *)i1) && *((@typ@ *)i2));\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*2#\n#OP= >*17, <*17#\n#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble)*2#\n#kind= maximum*17, minimum*17#\n*/\nstatic void \n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func) \n{\n\tregister intp i;\n\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n\tchar *i1=args[0], *i2=args[1], *op=args[2];\n\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n\t\t*((@typ@ *)op)=*((@typ@ *)i1) @OP@ *((@typ@ *)i2) ? *((@typ@ *)i1) : *((@typ@ *)i2);\n\t}\n}\n/**end repeat**/\n\n\n/*** isinf, isinf, isfinite, signbit ***/\n/**begin repeat\n#kind=isnan*3, isinf*3, isfinite*3, signbit*3#\n#TYPE=(FLOAT, DOUBLE, LONGDOUBLE)*4#\n#typ=(float, double, longdouble)*4#\n#c=(f,,l)*4#\n*/\nstatic void\n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is=steps[0], os=steps[1], n=dimensions[0];\n        char *ip=args[0], *op=args[1];\n        for(i=0; i<n; i++, ip+=is, op+=os) {\n                *((Bool *)op) = @kind@@c@(*((@typ@ *)ip));\n        }\n}\n/**end repeat**/\n\n\n/**begin repeat\n#kind=isnan*3, isinf*3, isfinite*3#\n#TYPE=(CFLOAT, CDOUBLE, CLONGDOUBLE)*3#\n#typ=(float, double, longdouble)*3#\n#c=(f,,l)*3#\n#OP=||*6,&&*3#\n*/\nstatic void\n@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is=steps[0], os=steps[1], n=dimensions[0];\n        char *ip=args[0], *op=args[1];\n        for(i=0; i<n; i++, ip+=is, op+=os) {\n                *((Bool *)op) = @kind@@c@(((@typ@ *)ip)[0]) @OP@        \\\n                        @kind@@c@(((@typ@ *)ip)[1]);\n        }\n}\n/**end repeat**/\n\n\n\n\n/****** modf ****/\n\n/**begin repeat\n#TYPE=FLOAT, DOUBLE, LONGDOUBLE#\n#typ=float, double, longdouble#\n#c=f,,l#\n*/\nstatic void\n@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is1=steps[0],os1=steps[1],os2=steps[2],n=dimensions[0];\n        char *i1=args[0], *op1=args[1], *op2=args[2];\n        @typ@ x1, y1, y2;\n        for (i=0; i<n; i++, i1+=is1, op1+=os1, op2+=os2) {\n                x1 = *((@typ@ *)i1);\n                y1 = modf@c@(x1, &y2);\n                *((@typ@ *)op1) = y1;\n                *((@typ@ *)op2) = y2;\n        }\n}\n/**end repeat**/\n\n#define HAVE_DOUBLE_FUNCS\n/**begin repeat\n#TYPE=FLOAT, DOUBLE, LONGDOUBLE#\n#typ=float, double, longdouble#\n#c=f,,l#\n*/\n#ifdef HAVE_@TYPE@_FUNCS\nstatic void\n@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is1=steps[0],os1=steps[1],os2=steps[2],n=dimensions[0];\n        char *i1=args[0], *op1=args[1], *op2=args[2];\n        @typ@ x1, y1;\n        int y2;\n        for (i=0; i<n; i++, i1+=is1, op1+=os1, op2+=os2) {\n                x1 = *((@typ@ *)i1);\n                y1 = frexp@c@(x1, &y2);\n                *((@typ@ *)op1) = y1;\n                *((int *) op2) = y2;\n        }\n}\n\nstatic void\n@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *func)\n{\n        register intp i;\n        intp is1=steps[0],is2=steps[1],os=steps[2],n=dimensions[0];\n        char *i1=args[0], *i2=args[1], *op=args[2];\n        @typ@ x1, y1;\n        int x2;\n        for (i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {\n                x1 = *((@typ@ *)i1);\n                x2 = *((int *)i2);\n                y1 = ldexp@c@(x1, x2);\n                *((@typ@ *)op) = y1;\n        }\n}\n#endif\n/**end repeat**/\n#undef HAVE_DOUBLE_FUNCS\n\n\nstatic PyUFuncGenericFunction frexp_functions[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        FLOAT_frexp,\n#endif\n        DOUBLE_frexp\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,LONGDOUBLE_frexp\n#endif\n};\n\nstatic void * blank3_data[] = { (void *)NULL, (void *)NULL, (void *)NULL};\nstatic char frexp_signatures[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        PyArray_FLOAT, PyArray_FLOAT, PyArray_INT,\n#endif\n        PyArray_DOUBLE, PyArray_DOUBLE, PyArray_INT\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,PyArray_LONGDOUBLE, PyArray_LONGDOUBLE, PyArray_INT\n#endif\n};\n\n\nstatic PyUFuncGenericFunction ldexp_functions[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        FLOAT_ldexp,\n#endif\n        DOUBLE_ldexp\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,LONGDOUBLE_ldexp\n#endif\n};\n\nstatic char ldexp_signatures[] = { \n#ifdef HAVE_FLOAT_FUNCS\n        PyArray_FLOAT, PyArray_INT, PyArray_FLOAT,\n#endif\n        PyArray_DOUBLE, PyArray_INT, PyArray_DOUBLE\n#ifdef HAVE_LONGDOUBLE_FUNCS\n        ,PyArray_LONGDOUBLE, PyArray_INT, PyArray_LONGDOUBLE\n#endif\n};\n\n\n\n#include \"__umath_generated.c\"\n\n\n#include \"ufuncobject.c\"\n\n#include \"__ufunc_api.c\"\n\nstatic double\npinf_init(void)\n{\n    double mul = 1e10;\n    double tmp = 0.0;\n    double pinf;\n\n    pinf = mul;\n    for (;;) {\n        pinf *= mul;\n        if (pinf == tmp) break;\n        tmp = pinf;\n    }\n    return pinf;\n}\n\nstatic double\npzero_init(void)\n{\n    double div = 1e10;\n    double tmp = 0.0;\n    double pinf;\n\n    pinf = div;\n    for (;;) {\n        pinf /= div;\n        if (pinf == tmp) break;\n        tmp = pinf;\n    }\n    return pinf;\n}\n\n/* Less automated additions to the ufuncs */\n\nstatic void\nInitOtherOperators(PyObject *dictionary) {\n        PyObject *f;\n        int num=1;\n     \n#ifdef HAVE_LONGDOUBLE_FUNCS\n        num += 1;\n#endif\n#ifdef HAVE_FLOAT_FUNCS\n        num += 1;\n#endif\n        f = PyUFunc_FromFuncAndData(frexp_functions, blank3_data, \n\t\t\t\t    frexp_signatures, num,\n                                    1, 2, PyUFunc_None, \"frexp\",\n                                    \"Split the number, x, into a normalized\"\\\n\t\t\t\t    \" fraction (y1) and exponent (y2)\",0);\n        PyDict_SetItemString(dictionary, \"frexp\", f);\n        Py_DECREF(f);\n\n        f = PyUFunc_FromFuncAndData(ldexp_functions, blank3_data, ldexp_signatures, num,\n                                    2, 1, PyUFunc_None, \"ldexp\",\n                                    \"Compute y = x1 * 2**x2.\",0);\n        PyDict_SetItemString(dictionary, \"ldexp\", f);\n        Py_DECREF(f);\n        return;\n}\n\n\nstatic struct PyMethodDef methods[] = {\n        {\"frompyfunc\", (PyCFunction) ufunc_frompyfunc,\n         METH_VARARGS | METH_KEYWORDS, doc_frompyfunc},\n\t{NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initumath(void) {\n\tPyObject *m, *d, *s, *s2, *c_api;\n\tdouble pinf, pzero, mynan;\n  \n\t/* Create the module and add the functions */\n\tm = Py_InitModule(\"umath\", methods); \n\n\t/* Import the array */\n\tif (import_array() < 0) return;\n\n\t/* Initialize the types */\n\tif (PyType_Ready(&PyUFunc_Type) < 0)\n                return;         \n\n\tif (PyType_Ready(&PyUFuncLoop_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyUFuncReduce_Type) < 0)\n                return; \n\n\n\t/* Add some symbolic constants to the module */\n\td = PyModule_GetDict(m);\n\n\tc_api = PyCObject_FromVoidPtr((void *)PyUFunc_API, NULL);\n\tif (PyErr_Occurred()) goto err;\n\tPyDict_SetItemString(d, \"_UFUNC_API\", c_api);\n\tPy_DECREF(c_api);\n\tif (PyErr_Occurred()) goto err;\n\n\ts = PyString_FromString(\"0.4.0\");\n\tPyDict_SetItemString(d, \"__version__\", s);\n\tPy_DECREF(s);\n\n\t/* Load the ufunc operators into the array module's namespace */\n\tInitOperators(d); \n\n        InitOtherOperators(d);\n\n\tPyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(M_PI));\n\tPy_DECREF(s);\n\tPyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n\tPy_DECREF(s);\n\n#define ADDCONST(str) PyModule_AddIntConstant(m, #str, UFUNC_##str)\n#define ADDSCONST(str) PyModule_AddStringConstant(m, \"UFUNC_\" #str, UFUNC_##str)\n\n        ADDCONST(ERR_IGNORE);\n        ADDCONST(ERR_WARN);\n        ADDCONST(ERR_CALL);\n        ADDCONST(ERR_RAISE);\n        ADDCONST(ERR_DEFAULT);\n\n        ADDCONST(SHIFT_DIVIDEBYZERO);\n        ADDCONST(SHIFT_OVERFLOW);\n        ADDCONST(SHIFT_UNDERFLOW);\n        ADDCONST(SHIFT_INVALID);\n                \n        ADDCONST(FPE_DIVIDEBYZERO);\n        ADDCONST(FPE_OVERFLOW);\n        ADDCONST(FPE_UNDERFLOW);\n        ADDCONST(FPE_INVALID);\n\n        ADDSCONST(ERRMASK_NAME);\n        ADDSCONST(ERRFUNC_NAME);\n        ADDSCONST(BUFSIZE_NAME);\n\n#undef ADDCONST\n#undef ADDSCONST\n        PyModule_AddIntConstant(m, \"UFUNC_BUFSIZE_DEFAULT\", (long)PyArray_BUFSIZE);\n        \n        pinf = pinf_init();\n        pzero = pzero_init();\n        mynan = pinf / pinf;\n\n        PyModule_AddObject(m, \"PINF\", PyFloat_FromDouble(pinf));\n        PyModule_AddObject(m, \"NINF\", PyFloat_FromDouble(-pinf));\n        PyModule_AddObject(m, \"PZERO\", PyFloat_FromDouble(pzero));\n        PyModule_AddObject(m, \"NZERO\", PyFloat_FromDouble(-pzero));\n        PyModule_AddObject(m, \"NAN\", PyFloat_FromDouble(mynan));\n\n\ts = PyDict_GetItemString(d, \"conjugate\");\n\ts2 = PyDict_GetItemString(d, \"remainder\");\n\t/* Setup the array object's numerical structures with appropriate \n\t   ufuncs in d*/\n\tPyArray_SetNumericOps(d);\n\n\tPyDict_SetItemString(d, \"conj\", s);\n\tPyDict_SetItemString(d, \"mod\", s2);\n\n err:  \n\t/* Check for errors */\n\tif (PyErr_Occurred())\n\t\tPy_FatalError(\"can't initialize module umath\");\n}\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [
                        "#TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2#",
                        "#OP= >*14, <*14#",
                        "#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*2#",
                        "#kind= maximum*14, minimum*14#",
                        "/**begin repeat",
                        "",
                        "#TYPE=(CFLOAT,CDOUBLE,CLONGDOUBLE)*2#",
                        "#OP= >*3, <*3#",
                        "#typ=(cfloat, cdouble, clongdouble)*2#",
                        "#kind= maximum*3, minimum*3#",
                        "*/",
                        "static void",
                        "@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)",
                        "{",
                        "\tregister intp i;",
                        "\tintp is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];",
                        "\tchar *i1=args[0], *i2=args[1], *op=args[2];",
                        "        @typ@ *i1c, *i2c;",
                        "\tfor(i=0; i<n; i++, i1+=is1, i2+=is2, op+=os) {",
                        "                i1c = (@typ@ *)i1;",
                        "                i2c = (@typ@ *)i2;",
                        "                if ((i1c->real @OP@ i2c->real) ||                       \\",
                        "                    ((i1c->real==i2c->real) && (i1c->imag @OP@ i2c->imag)))",
                        "                        memcpy(op, i1, sizeof(@typ@));",
                        "                else",
                        "                        memcpy(op, i2, sizeof(@typ@));",
                        "\t}",
                        "}",
                        "/**end repeat**/",
                        "",
                        ""
                    ],
                    "deleted": [
                        "#TYPE=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*2#",
                        "#OP= >*17, <*17#",
                        "#typ=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble)*2#",
                        "#kind= maximum*17, minimum*17#"
                    ]
                }
            }
        ]
    },
    {
        "hash": "2cfd18d956739dbb13bd312ec6b60b087f21ad53",
        "msg": "Fixed can cast safely.",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-13T23:49:15+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-13T23:49:15+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "2c6e233984b6af96d3bf3a38b4932aa5f4c433ad"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 34,
        "insertions": 16,
        "lines": 50,
        "files": 1,
        "dmm_unit_size": 1.0,
        "dmm_unit_complexity": 1.0,
        "dmm_unit_interfacing": 0.0,
        "modified_files": [
            {
                "old_path": "scipy/base/src/arrayobject.c",
                "new_path": "scipy/base/src/arrayobject.c",
                "filename": "arrayobject.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -5554,21 +5554,6 @@ PyArray_CanCastSafely(int fromtype, int totype)\n         case PyArray_BYTE:\n \tcase PyArray_SHORT:\n         case PyArray_INT:\n-\t\tif (PyTypeNum_ISINTEGER(totype)) {\n-\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {\n-\t\t\t\treturn (to->elsize > from->elsize);\n-\t\t\t}\n-\t\t\telse {\n-\t\t\t\treturn (to->elsize >= from->elsize);\n-\t\t\t}\n-\t\t}\n-\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n-\t\t\treturn (to->elsize > from->elsize);\n-\t\t}\n-\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n-\t\t\treturn ((to->elsize >> 1) > from->elsize);\n-\t\t}\n-\t\telse return totype > fromtype;\n         case PyArray_LONG:\n \tcase PyArray_LONGLONG:\n \t\tif (PyTypeNum_ISINTEGER(totype)) {\n@@ -5580,30 +5565,21 @@ PyArray_CanCastSafely(int fromtype, int totype)\n \t\t\t}\n \t\t}\n \t\telse if (PyTypeNum_ISFLOAT(totype)) {\n-\t\t\treturn (to->elsize >= from->elsize);\n+                        if (from->elsize < 8)\n+                                return (to->elsize > from->elsize);\n+                        else\n+                                return (to->elsize >= from->elsize);\n \t\t}\n \t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n-\t\t\treturn ((to->elsize >> 1) >= from->elsize);\n+                        if (from->elsize < 8)\n+                                return ((to->elsize >> 1) > from->elsize);\n+                        else\n+                                return ((to->elsize >> 1) >= from->elsize);\n \t\t}\n \t\telse return totype > fromtype;\n         case PyArray_UBYTE:\n         case PyArray_USHORT:\n         case PyArray_UINT:\n-\t\tif (PyTypeNum_ISINTEGER(totype)) {\n-\t\t\tif (PyTypeNum_ISSIGNED(totype)) {\n-\t\t\t\treturn (to->elsize > from->elsize);\n-\t\t\t}\n-\t\t\telse {\n-\t\t\t\treturn (to->elsize >= from->elsize);\n-\t\t\t}\n-\t\t}\n-\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n-\t\t\treturn (to->elsize > from->elsize);\n-\t\t}\n-\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n-\t\t\treturn ((to->elsize >> 1) > from->elsize);\n-\t\t}\n-\t\telse return totype > fromtype;\n \tcase PyArray_ULONG:\n \tcase PyArray_ULONGLONG:\n \t\tif (PyTypeNum_ISINTEGER(totype)) {\n@@ -5615,10 +5591,16 @@ PyArray_CanCastSafely(int fromtype, int totype)\n \t\t\t}\n \t\t}\n \t\telse if (PyTypeNum_ISFLOAT(totype)) {\n-\t\t\treturn (to->elsize >= from->elsize);\n+                        if (from->elsize < 8)\n+                                return (to->elsize > from->elsize);\n+                        else\n+                                return (to->elsize >= from->elsize);\n \t\t}\n \t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n-\t\t\treturn ((to->elsize >> 1) >= from->elsize);\n+                        if (from->elsize < 8)\n+                                return ((to->elsize >> 1) > from->elsize);\n+                        else\n+                                return ((to->elsize >> 1) >= from->elsize);\n \t\t}\n \t\telse return totype > fromtype;\n         case PyArray_FLOAT:\n",
                "added_lines": 16,
                "deleted_lines": 34,
                "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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tPyObject_Del(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\treturn PyErr_NoMemory();\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\tPyObject_Del(self);\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\treturn NULL;\n\t\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\tif (self->dimensions != NULL) \n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, BEHAVED_FLAGS);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, DEFAULT_FLAGS);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t     ENSURECOPY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tPyObject_Del(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\treturn PyErr_NoMemory();\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\tPyObject_Del(self);\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\treturn NULL;\n\t\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\tif (self->dimensions != NULL) \n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, BEHAVED_FLAGS);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, DEFAULT_FLAGS);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t     ENSURECOPY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\n        switch(fromtype) {\n        case PyArray_BYTE:\n\tcase PyArray_SHORT:\n        case PyArray_INT:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {\n\t\t\t\treturn (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize > from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) > from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) >= from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\n        case PyArray_UBYTE:\n        case PyArray_USHORT:\n        case PyArray_UINT:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISSIGNED(totype)) {\n\t\t\t\treturn (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize > from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) > from->elsize);\n\t\t}\n\t\telse return totype > fromtype;\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n\t\t\treturn (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n\t\t\treturn ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\n\n",
                "methods": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 112,
                        "complexity": 28,
                        "token_count": 672,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3288,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 145,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3293,
                        "end_line": 3398,
                        "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": 3402,
                        "end_line": 3419,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3423,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3545,
                        "end_line": 3548,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3551,
                        "end_line": 3561,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3634,
                        "end_line": 3637,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3641,
                        "end_line": 3675,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3679,
                        "end_line": 3682,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3685,
                        "end_line": 3718,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3722,
                        "end_line": 3729,
                        "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": 3732,
                        "end_line": 3740,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3744,
                        "end_line": 3758,
                        "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": 3761,
                        "end_line": 3805,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3809,
                        "end_line": 3812,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3815,
                        "end_line": 3822,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3826,
                        "end_line": 3833,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3836,
                        "end_line": 3856,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3859,
                        "end_line": 3881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3884,
                        "end_line": 3887,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3891,
                        "end_line": 3894,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3906,
                        "end_line": 3964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3969,
                        "end_line": 3979,
                        "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": 3983,
                        "end_line": 4008,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4012,
                        "end_line": 4044,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4047,
                        "end_line": 4082,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4085,
                        "end_line": 4122,
                        "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": 4125,
                        "end_line": 4128,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4131,
                        "end_line": 4185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4364,
                        "end_line": 4389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4392,
                        "end_line": 4414,
                        "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": 4421,
                        "end_line": 4447,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4450,
                        "end_line": 4470,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4473,
                        "end_line": 4614,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4617,
                        "end_line": 4640,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4644,
                        "end_line": 4667,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4671,
                        "end_line": 4728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4732,
                        "end_line": 4739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4745,
                        "end_line": 4835,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4841,
                        "end_line": 4852,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4855,
                        "end_line": 4890,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4897,
                        "end_line": 4943,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4946,
                        "end_line": 5077,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5081,
                        "end_line": 5186,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5189,
                        "end_line": 5284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5287,
                        "end_line": 5308,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5312,
                        "end_line": 5374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5377,
                        "end_line": 5382,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5385,
                        "end_line": 5391,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5445,
                        "end_line": 5475,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5486,
                        "end_line": 5502,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5508,
                        "end_line": 5514,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5517,
                        "end_line": 5524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5527,
                        "end_line": 5534,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5540,
                        "end_line": 5623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5626,
                        "end_line": 5650,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5660,
                        "end_line": 5697,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5702,
                        "end_line": 5712,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5715,
                        "end_line": 5720,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5723,
                        "end_line": 5728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5732,
                        "end_line": 5735,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5739,
                        "end_line": 5787,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5790,
                        "end_line": 5843,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5847,
                        "end_line": 5966,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5970,
                        "end_line": 6002,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6005,
                        "end_line": 6047,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6051,
                        "end_line": 6173,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6186,
                        "end_line": 6228,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6233,
                        "end_line": 6237,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6302,
                        "end_line": 6363,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6371,
                        "end_line": 6386,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6392,
                        "end_line": 6461,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6465,
                        "end_line": 6501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6507,
                        "end_line": 6551,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6569,
                        "end_line": 6705,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6711,
                        "end_line": 6780,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6783,
                        "end_line": 6916,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6922,
                        "end_line": 6952,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6958,
                        "end_line": 6969,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6972,
                        "end_line": 6981,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6984,
                        "end_line": 7002,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 112,
                        "complexity": 28,
                        "token_count": 672,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3288,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 145,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3293,
                        "end_line": 3398,
                        "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": 3402,
                        "end_line": 3419,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3423,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3545,
                        "end_line": 3548,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3551,
                        "end_line": 3561,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3634,
                        "end_line": 3637,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3641,
                        "end_line": 3675,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3679,
                        "end_line": 3682,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3685,
                        "end_line": 3718,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3722,
                        "end_line": 3729,
                        "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": 3732,
                        "end_line": 3740,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3744,
                        "end_line": 3758,
                        "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": 3761,
                        "end_line": 3805,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3809,
                        "end_line": 3812,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3815,
                        "end_line": 3822,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3826,
                        "end_line": 3833,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3836,
                        "end_line": 3856,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3859,
                        "end_line": 3881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3884,
                        "end_line": 3887,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3891,
                        "end_line": 3894,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3906,
                        "end_line": 3964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3969,
                        "end_line": 3979,
                        "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": 3983,
                        "end_line": 4008,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4012,
                        "end_line": 4044,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4047,
                        "end_line": 4082,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4085,
                        "end_line": 4122,
                        "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": 4125,
                        "end_line": 4128,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4131,
                        "end_line": 4185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4364,
                        "end_line": 4389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4392,
                        "end_line": 4414,
                        "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": 4421,
                        "end_line": 4447,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4450,
                        "end_line": 4470,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4473,
                        "end_line": 4614,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4617,
                        "end_line": 4640,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4644,
                        "end_line": 4667,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4671,
                        "end_line": 4728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4732,
                        "end_line": 4739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4745,
                        "end_line": 4835,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4841,
                        "end_line": 4852,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4855,
                        "end_line": 4890,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4897,
                        "end_line": 4943,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4946,
                        "end_line": 5077,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5081,
                        "end_line": 5186,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5189,
                        "end_line": 5284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5287,
                        "end_line": 5308,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5312,
                        "end_line": 5374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5377,
                        "end_line": 5382,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5385,
                        "end_line": 5391,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5445,
                        "end_line": 5475,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5486,
                        "end_line": 5502,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5508,
                        "end_line": 5514,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5517,
                        "end_line": 5524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5527,
                        "end_line": 5534,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 99,
                        "complexity": 43,
                        "token_count": 578,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5540,
                        "end_line": 5641,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 102,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5644,
                        "end_line": 5668,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5678,
                        "end_line": 5715,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5720,
                        "end_line": 5730,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5733,
                        "end_line": 5738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5741,
                        "end_line": 5746,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5750,
                        "end_line": 5753,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5757,
                        "end_line": 5805,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5808,
                        "end_line": 5861,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5865,
                        "end_line": 5984,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5988,
                        "end_line": 6020,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6023,
                        "end_line": 6065,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6069,
                        "end_line": 6191,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6204,
                        "end_line": 6246,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6251,
                        "end_line": 6255,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6320,
                        "end_line": 6381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6389,
                        "end_line": 6404,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6410,
                        "end_line": 6479,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6483,
                        "end_line": 6519,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6525,
                        "end_line": 6569,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6587,
                        "end_line": 6723,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6729,
                        "end_line": 6798,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6801,
                        "end_line": 6934,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6940,
                        "end_line": 6970,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6976,
                        "end_line": 6987,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6990,
                        "end_line": 6999,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 7002,
                        "end_line": 7020,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5540,
                        "end_line": 5623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 5549,
                "complexity": 1221,
                "token_count": 33191,
                "diff_parsed": {
                    "added": [
                        "                        if (from->elsize < 8)",
                        "                                return (to->elsize > from->elsize);",
                        "                        else",
                        "                                return (to->elsize >= from->elsize);",
                        "                        if (from->elsize < 8)",
                        "                                return ((to->elsize >> 1) > from->elsize);",
                        "                        else",
                        "                                return ((to->elsize >> 1) >= from->elsize);",
                        "                        if (from->elsize < 8)",
                        "                                return (to->elsize > from->elsize);",
                        "                        else",
                        "                                return (to->elsize >= from->elsize);",
                        "                        if (from->elsize < 8)",
                        "                                return ((to->elsize >> 1) > from->elsize);",
                        "                        else",
                        "                                return ((to->elsize >> 1) >= from->elsize);"
                    ],
                    "deleted": [
                        "\t\tif (PyTypeNum_ISINTEGER(totype)) {",
                        "\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {",
                        "\t\t\t\treturn (to->elsize > from->elsize);",
                        "\t\t\t}",
                        "\t\t\telse {",
                        "\t\t\t\treturn (to->elsize >= from->elsize);",
                        "\t\t\t}",
                        "\t\t}",
                        "\t\telse if (PyTypeNum_ISFLOAT(totype)) {",
                        "\t\t\treturn (to->elsize > from->elsize);",
                        "\t\t}",
                        "\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {",
                        "\t\t\treturn ((to->elsize >> 1) > from->elsize);",
                        "\t\t}",
                        "\t\telse return totype > fromtype;",
                        "\t\t\treturn (to->elsize >= from->elsize);",
                        "\t\t\treturn ((to->elsize >> 1) >= from->elsize);",
                        "\t\tif (PyTypeNum_ISINTEGER(totype)) {",
                        "\t\t\tif (PyTypeNum_ISSIGNED(totype)) {",
                        "\t\t\t\treturn (to->elsize > from->elsize);",
                        "\t\t\t}",
                        "\t\t\telse {",
                        "\t\t\t\treturn (to->elsize >= from->elsize);",
                        "\t\t\t}",
                        "\t\t}",
                        "\t\telse if (PyTypeNum_ISFLOAT(totype)) {",
                        "\t\t\treturn (to->elsize > from->elsize);",
                        "\t\t}",
                        "\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {",
                        "\t\t\treturn ((to->elsize >> 1) > from->elsize);",
                        "\t\t}",
                        "\t\telse return totype > fromtype;",
                        "\t\t\treturn (to->elsize >= from->elsize);",
                        "\t\t\treturn ((to->elsize >> 1) >= from->elsize);"
                    ]
                }
            }
        ]
    },
    {
        "hash": "9f1286587474fb3fcbdf2020b1fe47400ca20b68",
        "msg": "Fixed subclass PyArray_New error segfault.  Updated f2py for newscipy (a little)",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-14T01:47:07+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T01:47:07+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "2cfd18d956739dbb13bd312ec6b60b087f21ad53"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 26,
        "insertions": 78,
        "lines": 104,
        "files": 6,
        "dmm_unit_size": 0.4,
        "dmm_unit_complexity": 0.4,
        "dmm_unit_interfacing": 0.4,
        "modified_files": [
            {
                "old_path": "scipy/__init__.py",
                "new_path": "scipy/__init__.py",
                "filename": "__init__.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -6,6 +6,8 @@\n \n It is being distributed for a fee for a limited time to try and raise money for\n development.\n+\n+Documentation is also available in the docstrings.\n \"\"\"\n \n try:\n",
                "added_lines": 2,
                "deleted_lines": 0,
                "source_code": "\"\"\"SciPy Core\n\nYou can support the development of SciPy by purchasing documentation at\n\nhttp://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise money for\ndevelopment.\n\nDocumentation is also available in the docstrings.\n\"\"\"\n\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n",
                "source_code_before": "\"\"\"SciPy Core\n\nYou can support the development of SciPy by purchasing documentation at\n\nhttp://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise money for\ndevelopment.\n\"\"\"\n\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 28,
                "complexity": 0,
                "token_count": 102,
                "diff_parsed": {
                    "added": [
                        "",
                        "Documentation is also available in the docstrings."
                    ],
                    "deleted": []
                }
            },
            {
                "old_path": "scipy/base/index_tricks.py",
                "new_path": "scipy/base/index_tricks.py",
                "filename": "index_tricks.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -219,7 +219,7 @@ def __len__(self):\n \n # A simple nd index iterator over an array:\n \n-class ndenumerate(enumerate):\n+class ndenumerate(object):\n     def __init__(self, arr):\n         arr = asarray(arr)\n         self.iter = enumerate(arr.flat)\n@@ -241,6 +241,9 @@ def next(self):\n         indxs[self.nd-1] = val\n         return tuple(indxs), res[1]\n \n+    def __iter__(self):\n+        return self\n+\n \n \n # A nicer way to build up index tuples for arrays.\n",
                "added_lines": 4,
                "deleted_lines": 1,
                "source_code": "## Automatically adapted for scipy Sep 19, 2005 by convertcode.py\n\nimport types\nimport numeric as _nx\nfrom numeric import asarray\n__all__ = ['mgrid','ogrid','r_', 'c_', 'index_exp', 'ix_','ndenumerate']\n\nfrom type_check import ScalarType\nimport function_base\nimport twodim_base as matrix_base\nimport matrix\nmakemat = matrix.matrix\n\ndef ix_(*args):\n    \"\"\" Construct an open mesh from multiple sequences.\n\n    This function takes n 1-d sequences and returns n outputs with n\n    dimensions each such that the shape is 1 in all but one dimension and\n    the dimension with the non-unit shape value cycles through all n\n    dimensions.\n\n    Using ix_() one can quickly construct index arrays that will index\n    the cross product.\n\n    a[ix_([1,3,7],[2,5,8])]  returns the array\n\n    a[1,2]  a[1,5]  a[1,8]\n    a[3,2]  a[3,5]  a[3,8]\n    a[7,2]  a[7,5]  a[7,8]\n    \"\"\"\n    out = []\n    nd = len(args)\n    baseshape = [1]*nd\n    for k in range(nd):\n        new = _nx.array(args[k])\n        if (new.ndim <> 1):\n            raise ValueError, \"Cross index must be 1 dimensional\"\n        baseshape[k] = len(new)\n        new.shape = tuple(baseshape)\n        out.append(new)\n        baseshape[k] = 1\n    return tuple(out)\n\nclass nd_grid:\n    \"\"\" Construct a \"meshgrid\" in N-dimensions.\n\n        grid = nd_grid() creates an instance which will return a mesh-grid\n        when indexed.  The dimension and number of the output arrays are equal\n        to the number of indexing dimensions.  If the step length is not a\n        complex number, then the stop is not inclusive.\n    \n        However, if the step length is a COMPLEX NUMBER (e.g. 5j), then the\n        integer part of it's magnitude is interpreted as specifying the\n        number of points to create between the start and stop values, where\n        the stop value IS INCLUSIVE.\n\n        If instantiated with an argument of 1, the mesh-grid is open or not\n        fleshed out so that only one-dimension of each returned argument is\n        greater than 1\n    \n        Example:\n    \n           >>> mgrid = nd_grid()\n           >>> mgrid[0:5,0:5]\n           array([[[0, 0, 0, 0, 0],\n                   [1, 1, 1, 1, 1],\n                   [2, 2, 2, 2, 2],\n                   [3, 3, 3, 3, 3],\n                   [4, 4, 4, 4, 4]],\n                  [[0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4]]])\n           >>> mgrid[-1:1:5j]\n           array([-1. , -0.5,  0. ,  0.5,  1. ])\n\n           >>> ogrid = nd_grid(1)\n           >>> ogrid[0:5,0:5]\n           [array([[0],[1],[2],[3],[4]]), array([[0, 1, 2, 3, 4]])] \n    \"\"\"\n    def __init__(self, sparse=0):\n        self.sparse = sparse\n    def __getitem__(self,key):\n        try:\n\t    size = []\n            typecode = _nx.Int\n\t    for k in range(len(key)):\n\t        step = key[k].step\n                start = key[k].start\n                if start is None: start=0\n                if step is None: step=1\n                if type(step) is type(1j):\n                    size.append(int(abs(step)))\n                    typecode = _nx.Float\n                else:\n                    size.append(int((key[k].stop - start)/(step*1.0)))\n                if isinstance(step,types.FloatType) or \\\n                   isinstance(start, types.FloatType) or \\\n                   isinstance(key[k].stop, types.FloatType):\n                       typecode = _nx.Float\n            if self.sparse:\n                nn = map(lambda x,t: _nx.arange(x,dtype=t),size,(typecode,)*len(size))\n            else:\n                nn = _nx.indices(size,typecode)\n\t    for k in range(len(size)):\n                step = key[k].step\n                start = key[k].start\n                if start is None: start=0\n                if step is None: step=1\n                if type(step) is type(1j):\n                    step = int(abs(step))\n                    step = (key[k].stop - start)/float(step-1)\n                nn[k] = (nn[k]*step+start)\n            if self.sparse:\n                slobj = [_nx.NewAxis]*len(size)\n                for k in range(len(size)):\n                    slobj[k] = slice(None,None)\n                    nn[k] = nn[k][slobj]\n                    slobj[k] = _nx.NewAxis\n\t    return nn\n        except (IndexError, TypeError):\n            step = key.step\n            stop = key.stop\n            start = key.start\n            if start is None: start = 0\n            if type(step) is type(1j):\n                step = abs(step)\n                length = int(step)\n                step = (key.stop-start)/float(step-1)\n                stop = key.stop+step\n                return _nx.arange(0,length,1,_nx.Float)*step + start\n            else:\n                return _nx.arange(start, stop, step)\n\t    \n    def __getslice__(self,i,j):\n        return _nx.arange(i,j)\n\n    def __len__(self):\n        return 0\n\nmgrid = nd_grid()\nogrid = nd_grid(1)\n\nimport sys\nclass concatenator:\n    \"\"\" Translates slice objects to concatenation along an axis.\n    \"\"\"\n    def _retval(self, res):\n        if self.matrix:\n            oldndim = res.ndim\n            res = makemat(res)\n            if oldndim == 1 and self.col:\n                res = res.T\n        self.axis=self._axis\n        self.matrix=self._matrix\n        self.col=0\n        return res\n        \n    def __init__(self, axis=0, matrix=0):\n        self._axis = axis\n        self._matrix = matrix\n        self.axis = axis\n        self.matrix = matrix\n        self.col = 0\n    def __getitem__(self,key):\n        if isinstance(key,types.StringType):\n            frame = sys._getframe().f_back\n            mymat = matrix.bmat(key,frame.f_globals,frame.f_locals)\n            return mymat\n        if type(key) is not types.TupleType:\n            key = (key,)\n        objs = []\n        for k in range(len(key)):\n            if type(key[k]) is types.SliceType:\n                typecode = _nx.Int\n\t        step = key[k].step\n                start = key[k].start\n                stop = key[k].stop\n                if start is None: start = 0\n                if step is None:\n                    step = 1\n                if type(step) is type(1j):\n                    size = int(abs(step))\n                    typecode = _nx.Float\n                    newobj = function_base.linspace(start, stop, num=size)\n                else:\n                    newobj = _nx.arange(start, stop, step)\n            elif type(key[k]) is types.StringType:\n                if (key[k] in 'rc'):\n                    self.matrix = 1\n                    self.col = (key[k] == 'c')\n                    continue\n                try:\n                    self.axis = int(key[k])\n                    continue\n                except:\n                    raise ValueError, \"Unknown special directive.\"\n            elif type(key[k]) in ScalarType:\n                newobj = asarray([key[k]])                \n            else:\n                newobj = key[k]\n            objs.append(newobj)\n        res = _nx.concatenate(tuple(objs),axis=self.axis)\n        return self._retval(res)\n\n    def __getslice__(self,i,j):\n        res = _nx.arange(i,j)\n        return self._retval(res)\n\n    def __len__(self):\n        return 0\n\nr_=concatenator(0)\nc_=concatenator(-1)\n#row = concatenator(0,1)\n#col = concatenator(-1,1)\n\n\n# A simple nd index iterator over an array:\n\nclass ndenumerate(object):\n    def __init__(self, arr):\n        arr = asarray(arr)\n        self.iter = enumerate(arr.flat)\n        self.ashape = arr.shape\n        self.nd = arr.ndim\n        self.factors = [None]*(self.nd-1)\n        val = self.ashape[-1]\n        for i in range(self.nd-1,0,-1):\n            self.factors[i-1] = val\n            val *= self.ashape[i-1]\n\n    def next(self):\n        res = self.iter.next()\n        indxs = [None]*self.nd\n        val = res[0]\n        for i in range(self.nd-1):\n            indxs[i] = val / self.factors[i]\n            val = val % self.factors[i]\n        indxs[self.nd-1] = val\n        return tuple(indxs), res[1]\n\n    def __iter__(self):\n        return self\n\n\n\n# A nicer way to build up index tuples for arrays.\n#\n# You can do all this with slice() plus a few special objects,\n# but there's a lot to remember. This version is simpler because\n# it uses the standard array indexing syntax.\n#\n# Written by Konrad Hinsen <hinsen@cnrs-orleans.fr>\n# last revision: 1999-7-23\n#\n# Cosmetic changes by T. Oliphant 2001\n#\n#\n# This module provides a convenient method for constructing\n# array indices algorithmically. It provides one importable object,\n# 'index_expression'.\n#\n# For any index combination, including slicing and axis insertion,\n# 'a[indices]' is the same as 'a[index_expression[indices]]' for any\n# array 'a'. However, 'index_expression[indices]' can be used anywhere\n# in Python code and returns a tuple of slice objects that can be\n# used in the construction of complex index expressions.\n\nclass _index_expression_class:\n    import sys\n    maxint = sys.maxint\n\n    def __getitem__(self, item):\n        if type(item) != type(()):\n            return (item,)\n        else:\n            return item\n\n    def __len__(self):\n        return self.maxint\n\n    def __getslice__(self, start, stop):\n        if stop == self.maxint:\n            stop = None\n        return self[start:stop:None]\n\nindex_exp = _index_expression_class()\n\n# End contribution from Konrad.\n\n",
                "source_code_before": "## Automatically adapted for scipy Sep 19, 2005 by convertcode.py\n\nimport types\nimport numeric as _nx\nfrom numeric import asarray\n__all__ = ['mgrid','ogrid','r_', 'c_', 'index_exp', 'ix_','ndenumerate']\n\nfrom type_check import ScalarType\nimport function_base\nimport twodim_base as matrix_base\nimport matrix\nmakemat = matrix.matrix\n\ndef ix_(*args):\n    \"\"\" Construct an open mesh from multiple sequences.\n\n    This function takes n 1-d sequences and returns n outputs with n\n    dimensions each such that the shape is 1 in all but one dimension and\n    the dimension with the non-unit shape value cycles through all n\n    dimensions.\n\n    Using ix_() one can quickly construct index arrays that will index\n    the cross product.\n\n    a[ix_([1,3,7],[2,5,8])]  returns the array\n\n    a[1,2]  a[1,5]  a[1,8]\n    a[3,2]  a[3,5]  a[3,8]\n    a[7,2]  a[7,5]  a[7,8]\n    \"\"\"\n    out = []\n    nd = len(args)\n    baseshape = [1]*nd\n    for k in range(nd):\n        new = _nx.array(args[k])\n        if (new.ndim <> 1):\n            raise ValueError, \"Cross index must be 1 dimensional\"\n        baseshape[k] = len(new)\n        new.shape = tuple(baseshape)\n        out.append(new)\n        baseshape[k] = 1\n    return tuple(out)\n\nclass nd_grid:\n    \"\"\" Construct a \"meshgrid\" in N-dimensions.\n\n        grid = nd_grid() creates an instance which will return a mesh-grid\n        when indexed.  The dimension and number of the output arrays are equal\n        to the number of indexing dimensions.  If the step length is not a\n        complex number, then the stop is not inclusive.\n    \n        However, if the step length is a COMPLEX NUMBER (e.g. 5j), then the\n        integer part of it's magnitude is interpreted as specifying the\n        number of points to create between the start and stop values, where\n        the stop value IS INCLUSIVE.\n\n        If instantiated with an argument of 1, the mesh-grid is open or not\n        fleshed out so that only one-dimension of each returned argument is\n        greater than 1\n    \n        Example:\n    \n           >>> mgrid = nd_grid()\n           >>> mgrid[0:5,0:5]\n           array([[[0, 0, 0, 0, 0],\n                   [1, 1, 1, 1, 1],\n                   [2, 2, 2, 2, 2],\n                   [3, 3, 3, 3, 3],\n                   [4, 4, 4, 4, 4]],\n                  [[0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4],\n                   [0, 1, 2, 3, 4]]])\n           >>> mgrid[-1:1:5j]\n           array([-1. , -0.5,  0. ,  0.5,  1. ])\n\n           >>> ogrid = nd_grid(1)\n           >>> ogrid[0:5,0:5]\n           [array([[0],[1],[2],[3],[4]]), array([[0, 1, 2, 3, 4]])] \n    \"\"\"\n    def __init__(self, sparse=0):\n        self.sparse = sparse\n    def __getitem__(self,key):\n        try:\n\t    size = []\n            typecode = _nx.Int\n\t    for k in range(len(key)):\n\t        step = key[k].step\n                start = key[k].start\n                if start is None: start=0\n                if step is None: step=1\n                if type(step) is type(1j):\n                    size.append(int(abs(step)))\n                    typecode = _nx.Float\n                else:\n                    size.append(int((key[k].stop - start)/(step*1.0)))\n                if isinstance(step,types.FloatType) or \\\n                   isinstance(start, types.FloatType) or \\\n                   isinstance(key[k].stop, types.FloatType):\n                       typecode = _nx.Float\n            if self.sparse:\n                nn = map(lambda x,t: _nx.arange(x,dtype=t),size,(typecode,)*len(size))\n            else:\n                nn = _nx.indices(size,typecode)\n\t    for k in range(len(size)):\n                step = key[k].step\n                start = key[k].start\n                if start is None: start=0\n                if step is None: step=1\n                if type(step) is type(1j):\n                    step = int(abs(step))\n                    step = (key[k].stop - start)/float(step-1)\n                nn[k] = (nn[k]*step+start)\n            if self.sparse:\n                slobj = [_nx.NewAxis]*len(size)\n                for k in range(len(size)):\n                    slobj[k] = slice(None,None)\n                    nn[k] = nn[k][slobj]\n                    slobj[k] = _nx.NewAxis\n\t    return nn\n        except (IndexError, TypeError):\n            step = key.step\n            stop = key.stop\n            start = key.start\n            if start is None: start = 0\n            if type(step) is type(1j):\n                step = abs(step)\n                length = int(step)\n                step = (key.stop-start)/float(step-1)\n                stop = key.stop+step\n                return _nx.arange(0,length,1,_nx.Float)*step + start\n            else:\n                return _nx.arange(start, stop, step)\n\t    \n    def __getslice__(self,i,j):\n        return _nx.arange(i,j)\n\n    def __len__(self):\n        return 0\n\nmgrid = nd_grid()\nogrid = nd_grid(1)\n\nimport sys\nclass concatenator:\n    \"\"\" Translates slice objects to concatenation along an axis.\n    \"\"\"\n    def _retval(self, res):\n        if self.matrix:\n            oldndim = res.ndim\n            res = makemat(res)\n            if oldndim == 1 and self.col:\n                res = res.T\n        self.axis=self._axis\n        self.matrix=self._matrix\n        self.col=0\n        return res\n        \n    def __init__(self, axis=0, matrix=0):\n        self._axis = axis\n        self._matrix = matrix\n        self.axis = axis\n        self.matrix = matrix\n        self.col = 0\n    def __getitem__(self,key):\n        if isinstance(key,types.StringType):\n            frame = sys._getframe().f_back\n            mymat = matrix.bmat(key,frame.f_globals,frame.f_locals)\n            return mymat\n        if type(key) is not types.TupleType:\n            key = (key,)\n        objs = []\n        for k in range(len(key)):\n            if type(key[k]) is types.SliceType:\n                typecode = _nx.Int\n\t        step = key[k].step\n                start = key[k].start\n                stop = key[k].stop\n                if start is None: start = 0\n                if step is None:\n                    step = 1\n                if type(step) is type(1j):\n                    size = int(abs(step))\n                    typecode = _nx.Float\n                    newobj = function_base.linspace(start, stop, num=size)\n                else:\n                    newobj = _nx.arange(start, stop, step)\n            elif type(key[k]) is types.StringType:\n                if (key[k] in 'rc'):\n                    self.matrix = 1\n                    self.col = (key[k] == 'c')\n                    continue\n                try:\n                    self.axis = int(key[k])\n                    continue\n                except:\n                    raise ValueError, \"Unknown special directive.\"\n            elif type(key[k]) in ScalarType:\n                newobj = asarray([key[k]])                \n            else:\n                newobj = key[k]\n            objs.append(newobj)\n        res = _nx.concatenate(tuple(objs),axis=self.axis)\n        return self._retval(res)\n\n    def __getslice__(self,i,j):\n        res = _nx.arange(i,j)\n        return self._retval(res)\n\n    def __len__(self):\n        return 0\n\nr_=concatenator(0)\nc_=concatenator(-1)\n#row = concatenator(0,1)\n#col = concatenator(-1,1)\n\n\n# A simple nd index iterator over an array:\n\nclass ndenumerate(enumerate):\n    def __init__(self, arr):\n        arr = asarray(arr)\n        self.iter = enumerate(arr.flat)\n        self.ashape = arr.shape\n        self.nd = arr.ndim\n        self.factors = [None]*(self.nd-1)\n        val = self.ashape[-1]\n        for i in range(self.nd-1,0,-1):\n            self.factors[i-1] = val\n            val *= self.ashape[i-1]\n\n    def next(self):\n        res = self.iter.next()\n        indxs = [None]*self.nd\n        val = res[0]\n        for i in range(self.nd-1):\n            indxs[i] = val / self.factors[i]\n            val = val % self.factors[i]\n        indxs[self.nd-1] = val\n        return tuple(indxs), res[1]\n\n\n\n# A nicer way to build up index tuples for arrays.\n#\n# You can do all this with slice() plus a few special objects,\n# but there's a lot to remember. This version is simpler because\n# it uses the standard array indexing syntax.\n#\n# Written by Konrad Hinsen <hinsen@cnrs-orleans.fr>\n# last revision: 1999-7-23\n#\n# Cosmetic changes by T. Oliphant 2001\n#\n#\n# This module provides a convenient method for constructing\n# array indices algorithmically. It provides one importable object,\n# 'index_expression'.\n#\n# For any index combination, including slicing and axis insertion,\n# 'a[indices]' is the same as 'a[index_expression[indices]]' for any\n# array 'a'. However, 'index_expression[indices]' can be used anywhere\n# in Python code and returns a tuple of slice objects that can be\n# used in the construction of complex index expressions.\n\nclass _index_expression_class:\n    import sys\n    maxint = sys.maxint\n\n    def __getitem__(self, item):\n        if type(item) != type(()):\n            return (item,)\n        else:\n            return item\n\n    def __len__(self):\n        return self.maxint\n\n    def __getslice__(self, start, stop):\n        if stop == self.maxint:\n            stop = None\n        return self[start:stop:None]\n\nindex_exp = _index_expression_class()\n\n# End contribution from Konrad.\n\n",
                "methods": [
                    {
                        "name": "ix_",
                        "long_name": "ix_( * args )",
                        "filename": "index_tricks.py",
                        "nloc": 13,
                        "complexity": 3,
                        "token_count": 91,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 14,
                        "end_line": 42,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , sparse = 0 )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 14,
                        "parameters": [
                            "self",
                            "sparse"
                        ],
                        "start_line": 82,
                        "end_line": 83,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , key )",
                        "filename": "index_tricks.py",
                        "nloc": 51,
                        "complexity": 18,
                        "token_count": 472,
                        "parameters": [
                            "self",
                            "key"
                        ],
                        "start_line": 84,
                        "end_line": 134,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getslice__",
                        "long_name": "__getslice__( self , i , j )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self",
                            "i",
                            "j"
                        ],
                        "start_line": 136,
                        "end_line": 137,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__len__",
                        "long_name": "__len__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 7,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 139,
                        "end_line": 140,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_retval",
                        "long_name": "_retval( self , res )",
                        "filename": "index_tricks.py",
                        "nloc": 10,
                        "complexity": 4,
                        "token_count": 58,
                        "parameters": [
                            "self",
                            "res"
                        ],
                        "start_line": 149,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , axis = 0 , matrix = 0 )",
                        "filename": "index_tricks.py",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 38,
                        "parameters": [
                            "self",
                            "axis",
                            "matrix"
                        ],
                        "start_line": 160,
                        "end_line": 165,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , key )",
                        "filename": "index_tricks.py",
                        "nloc": 40,
                        "complexity": 12,
                        "token_count": 308,
                        "parameters": [
                            "self",
                            "key"
                        ],
                        "start_line": 166,
                        "end_line": 205,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getslice__",
                        "long_name": "__getslice__( self , i , j )",
                        "filename": "index_tricks.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "i",
                            "j"
                        ],
                        "start_line": 207,
                        "end_line": 209,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__len__",
                        "long_name": "__len__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 7,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 211,
                        "end_line": 212,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , arr )",
                        "filename": "index_tricks.py",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 99,
                        "parameters": [
                            "self",
                            "arr"
                        ],
                        "start_line": 223,
                        "end_line": 232,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "next",
                        "long_name": "next( self )",
                        "filename": "index_tricks.py",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 84,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 234,
                        "end_line": 242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__iter__",
                        "long_name": "__iter__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 7,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 244,
                        "end_line": 245,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , item )",
                        "filename": "index_tricks.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 28,
                        "parameters": [
                            "self",
                            "item"
                        ],
                        "start_line": 275,
                        "end_line": 279,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__len__",
                        "long_name": "__len__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 9,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 281,
                        "end_line": 282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getslice__",
                        "long_name": "__getslice__( self , start , stop )",
                        "filename": "index_tricks.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 28,
                        "parameters": [
                            "self",
                            "start",
                            "stop"
                        ],
                        "start_line": 284,
                        "end_line": 287,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 1
                    }
                ],
                "methods_before": [
                    {
                        "name": "ix_",
                        "long_name": "ix_( * args )",
                        "filename": "index_tricks.py",
                        "nloc": 13,
                        "complexity": 3,
                        "token_count": 91,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 14,
                        "end_line": 42,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , sparse = 0 )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 14,
                        "parameters": [
                            "self",
                            "sparse"
                        ],
                        "start_line": 82,
                        "end_line": 83,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , key )",
                        "filename": "index_tricks.py",
                        "nloc": 51,
                        "complexity": 18,
                        "token_count": 472,
                        "parameters": [
                            "self",
                            "key"
                        ],
                        "start_line": 84,
                        "end_line": 134,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getslice__",
                        "long_name": "__getslice__( self , i , j )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self",
                            "i",
                            "j"
                        ],
                        "start_line": 136,
                        "end_line": 137,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__len__",
                        "long_name": "__len__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 7,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 139,
                        "end_line": 140,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_retval",
                        "long_name": "_retval( self , res )",
                        "filename": "index_tricks.py",
                        "nloc": 10,
                        "complexity": 4,
                        "token_count": 58,
                        "parameters": [
                            "self",
                            "res"
                        ],
                        "start_line": 149,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , axis = 0 , matrix = 0 )",
                        "filename": "index_tricks.py",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 38,
                        "parameters": [
                            "self",
                            "axis",
                            "matrix"
                        ],
                        "start_line": 160,
                        "end_line": 165,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , key )",
                        "filename": "index_tricks.py",
                        "nloc": 40,
                        "complexity": 12,
                        "token_count": 308,
                        "parameters": [
                            "self",
                            "key"
                        ],
                        "start_line": 166,
                        "end_line": 205,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getslice__",
                        "long_name": "__getslice__( self , i , j )",
                        "filename": "index_tricks.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "i",
                            "j"
                        ],
                        "start_line": 207,
                        "end_line": 209,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__len__",
                        "long_name": "__len__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 7,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 211,
                        "end_line": 212,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , arr )",
                        "filename": "index_tricks.py",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 99,
                        "parameters": [
                            "self",
                            "arr"
                        ],
                        "start_line": 223,
                        "end_line": 232,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "next",
                        "long_name": "next( self )",
                        "filename": "index_tricks.py",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 84,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 234,
                        "end_line": 242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getitem__",
                        "long_name": "__getitem__( self , item )",
                        "filename": "index_tricks.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 28,
                        "parameters": [
                            "self",
                            "item"
                        ],
                        "start_line": 272,
                        "end_line": 276,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__len__",
                        "long_name": "__len__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 9,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 278,
                        "end_line": 279,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__getslice__",
                        "long_name": "__getslice__( self , start , stop )",
                        "filename": "index_tricks.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 28,
                        "parameters": [
                            "self",
                            "start",
                            "stop"
                        ],
                        "start_line": 281,
                        "end_line": 284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 1
                    }
                ],
                "changed_methods": [
                    {
                        "name": "__iter__",
                        "long_name": "__iter__( self )",
                        "filename": "index_tricks.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 7,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 244,
                        "end_line": 245,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    }
                ],
                "nloc": 223,
                "complexity": 53,
                "token_count": 1409,
                "diff_parsed": {
                    "added": [
                        "class ndenumerate(object):",
                        "    def __iter__(self):",
                        "        return self",
                        ""
                    ],
                    "deleted": [
                        "class ndenumerate(enumerate):"
                    ]
                }
            },
            {
                "old_path": "scipy/base/numeric.py",
                "new_path": "scipy/base/numeric.py",
                "filename": "numeric.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -27,17 +27,17 @@\n register_dtype = multiarray.register_dtype\n can_cast = multiarray.can_cast\n \n-def asarray(a, dtype=None):\n-    \"\"\"asarray(a,dtype=None) returns a as an array.  Unlike array(),\n+def asarray(a, dtype=None, fortran=False):\n+    \"\"\"returns a as an array.  Unlike array(),\n     no copy is performed if a is already an array.  Subclasses are converted\n     to base class ndarray.\n     \"\"\"\n-    return array(a, dtype, copy=0)\n+    return array(a, dtype, copy=0, fortran=fortran)\n \n-def asanyarray(a, dtype=None):\n+def asanyarray(a, dtype=None,copy=0,fortran=False):\n     \"\"\"will pass subclasses through...\n     \"\"\"\n-    return array(a, dtype, copy=0, subok=1)\n+    return array(a, dtype, copy=0, fortran=fortran, subok=1)\n \n def isfortran(a):\n     return a.flags['FNC']\n",
                "added_lines": 5,
                "deleted_lines": 5,
                "source_code": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None, fortran=False):\n    \"\"\"returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran)\n\ndef asanyarray(a, dtype=None,copy=0,fortran=False):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asndarray(a)\n   b = asndarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asndarray(a), axisa)\n    b = _move_axis_to_0(asndarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "source_code_before": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None):\n    \"\"\"asarray(a,dtype=None) returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0)\n\ndef asanyarray(a, dtype=None):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asndarray(a)\n   b = asndarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asndarray(a), axisa)\n    b = _move_axis_to_0(asndarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "methods": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "a",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None , copy = 0 , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 37,
                        "parameters": [
                            "a",
                            "dtype",
                            "copy",
                            "fortran"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 42,
                        "end_line": 43,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 71,
                        "end_line": 74,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 76,
                        "end_line": 78,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 81,
                        "end_line": 89,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 104,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 116,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 118,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 122,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 182,
                        "end_line": 198,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 210,
                        "end_line": 218,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 220,
                        "end_line": 230,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 237,
                        "end_line": 240,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 246,
                        "end_line": 253,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 255,
                        "end_line": 261,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 263,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 287,
                        "end_line": 306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 310,
                        "end_line": 327,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 329,
                        "end_line": 343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 347,
                        "end_line": 358,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 42,
                        "end_line": 43,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 71,
                        "end_line": 74,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 76,
                        "end_line": 78,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 81,
                        "end_line": 89,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 104,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 116,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 118,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 122,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 182,
                        "end_line": 198,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 210,
                        "end_line": 218,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 220,
                        "end_line": 230,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 237,
                        "end_line": 240,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 246,
                        "end_line": 253,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 255,
                        "end_line": 261,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 263,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 287,
                        "end_line": 306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 310,
                        "end_line": 327,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 329,
                        "end_line": 343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 347,
                        "end_line": 358,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "a",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "a",
                            "dtype"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None , copy = 0 , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 37,
                        "parameters": [
                            "a",
                            "dtype",
                            "copy",
                            "fortran"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 240,
                "complexity": 64,
                "token_count": 1957,
                "diff_parsed": {
                    "added": [
                        "def asarray(a, dtype=None, fortran=False):",
                        "    \"\"\"returns a as an array.  Unlike array(),",
                        "    return array(a, dtype, copy=0, fortran=fortran)",
                        "def asanyarray(a, dtype=None,copy=0,fortran=False):",
                        "    return array(a, dtype, copy=0, fortran=fortran, subok=1)"
                    ],
                    "deleted": [
                        "def asarray(a, dtype=None):",
                        "    \"\"\"asarray(a,dtype=None) returns a as an array.  Unlike array(),",
                        "    return array(a, dtype, copy=0)",
                        "def asanyarray(a, dtype=None):",
                        "    return array(a, dtype, copy=0, subok=1)"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/arrayobject.c",
                "new_path": "scipy/base/src/arrayobject.c",
                "filename": "arrayobject.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -3192,7 +3192,7 @@ PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n \t\tif (itemsize < 1) {\n \t\t\tPyErr_SetString(PyExc_ValueError,\n \t\t\t\t\t\"Type must provide an itemsize.\");\n-\t\t\tPyObject_Del(self);\n+\t\t\tself->ob_type->tp_free((PyObject *)self);\n \t\t\treturn NULL;\n \t\t}\n \t\tself->itemsize = itemsize;\n@@ -3209,7 +3209,7 @@ PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n \tif (nd > 0) {\n \t\tself->dimensions = PyDimMem_NEW(2*nd);\n \t\tif (self->dimensions == NULL) {\n-\t\t\tPyObject_Del(self);\n+\t\t\tself->ob_type->tp_free((PyObject *)self);\n \t\t\treturn PyErr_NoMemory();\n \t\t}\n \t\tself->strides = self->dimensions + nd;\n@@ -3224,10 +3224,10 @@ PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\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\tPyObject_Del(self);\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\t\n+\t\t\t}\t\t\t\t\n \t\t\tmemcpy(self->strides, strides, sizeof(intp)*nd);\n \t\t}\n \t}\n@@ -3244,9 +3244,8 @@ PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n \t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n \n \t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n-\t\t\tPyObject_Del(self);\n-\t\t\tif (self->dimensions != NULL) \n-\t\t\t\tPyDimMem_FREE(self->dimensions);\n+\t\t\tPyDimMem_FREE(self->dimensions);\n+\t\t\tself->ob_type->tp_free((PyObject *)self);\n \t\t\treturn PyErr_NoMemory();\n \t\t}\n \t\tself->flags |= OWN_DATA;\n@@ -5510,7 +5509,7 @@ PyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth)\n \tPyArray_Typecode typecode = {0, 0, 0};\n \ttypecode.type_num = type;\n         return PyArray_FromAny(op, &typecode, min_depth,\n-\t\t\t     max_depth, BEHAVED_FLAGS);\n+\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n }\n \n static PyObject *\n@@ -5520,7 +5519,7 @@ PyArray_ContiguousFromObject(PyObject *op, int type, int min_depth,\n \tPyArray_Typecode typecode = {0, 0, 0};\n \ttypecode.type_num = type;\n         return PyArray_FromAny(op, &typecode, min_depth,\n-\t\t\t     max_depth, DEFAULT_FLAGS);\n+\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n }\n \n static PyObject *\n@@ -5530,7 +5529,7 @@ PyArray_CopyFromObject(PyObject *op, int type, int min_depth,\n \tPyArray_Typecode typecode = {0, 0, 0};\n \ttypecode.type_num = type;\n         return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n-\t\t\t     ENSURECOPY);\n+\t\t\t       ENSURECOPY | ENSUREARRAY);\n }\n \n /* End of deprecated */\n",
                "added_lines": 9,
                "deleted_lines": 10,
                "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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tPyObject_Del(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\treturn PyErr_NoMemory();\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\tPyObject_Del(self);\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\treturn NULL;\n\t\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyObject_Del(self);\n\t\t\tif (self->dimensions != NULL) \n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, BEHAVED_FLAGS);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t     max_depth, DEFAULT_FLAGS);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t     ENSURECOPY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\n\n",
                "methods": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3287,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3292,
                        "end_line": 3397,
                        "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": 3401,
                        "end_line": 3418,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3422,
                        "end_line": 3537,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3544,
                        "end_line": 3547,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3550,
                        "end_line": 3560,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3633,
                        "end_line": 3636,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3640,
                        "end_line": 3674,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3678,
                        "end_line": 3681,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3684,
                        "end_line": 3717,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3721,
                        "end_line": 3728,
                        "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": 3731,
                        "end_line": 3739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3743,
                        "end_line": 3757,
                        "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": 3760,
                        "end_line": 3804,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3808,
                        "end_line": 3811,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3814,
                        "end_line": 3821,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3825,
                        "end_line": 3832,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3835,
                        "end_line": 3855,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3858,
                        "end_line": 3880,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3883,
                        "end_line": 3886,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3890,
                        "end_line": 3893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3905,
                        "end_line": 3963,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3968,
                        "end_line": 3978,
                        "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": 3982,
                        "end_line": 4007,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4011,
                        "end_line": 4043,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4046,
                        "end_line": 4081,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4084,
                        "end_line": 4121,
                        "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": 4124,
                        "end_line": 4127,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4130,
                        "end_line": 4184,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4363,
                        "end_line": 4388,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4391,
                        "end_line": 4413,
                        "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": 4420,
                        "end_line": 4446,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4449,
                        "end_line": 4469,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4472,
                        "end_line": 4613,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4616,
                        "end_line": 4639,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4643,
                        "end_line": 4666,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4670,
                        "end_line": 4727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4731,
                        "end_line": 4738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4744,
                        "end_line": 4834,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4840,
                        "end_line": 4851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4854,
                        "end_line": 4889,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4896,
                        "end_line": 4942,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4945,
                        "end_line": 5076,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5080,
                        "end_line": 5185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5188,
                        "end_line": 5283,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5286,
                        "end_line": 5307,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5311,
                        "end_line": 5373,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5376,
                        "end_line": 5381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5384,
                        "end_line": 5390,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5444,
                        "end_line": 5474,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5485,
                        "end_line": 5501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5507,
                        "end_line": 5513,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5516,
                        "end_line": 5523,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5526,
                        "end_line": 5533,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5539,
                        "end_line": 5622,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5625,
                        "end_line": 5649,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5659,
                        "end_line": 5696,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5701,
                        "end_line": 5711,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5714,
                        "end_line": 5719,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5722,
                        "end_line": 5727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5731,
                        "end_line": 5734,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5738,
                        "end_line": 5786,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5789,
                        "end_line": 5842,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5846,
                        "end_line": 5965,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5969,
                        "end_line": 6001,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6004,
                        "end_line": 6046,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6050,
                        "end_line": 6172,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6185,
                        "end_line": 6227,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6232,
                        "end_line": 6236,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6301,
                        "end_line": 6362,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6370,
                        "end_line": 6385,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6391,
                        "end_line": 6460,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6464,
                        "end_line": 6500,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6506,
                        "end_line": 6550,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6568,
                        "end_line": 6704,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6710,
                        "end_line": 6779,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6782,
                        "end_line": 6915,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6921,
                        "end_line": 6951,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6957,
                        "end_line": 6968,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6971,
                        "end_line": 6980,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6983,
                        "end_line": 7001,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 112,
                        "complexity": 28,
                        "token_count": 672,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3288,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 145,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3293,
                        "end_line": 3398,
                        "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": 3402,
                        "end_line": 3419,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3423,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3545,
                        "end_line": 3548,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3551,
                        "end_line": 3561,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3634,
                        "end_line": 3637,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3641,
                        "end_line": 3675,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3679,
                        "end_line": 3682,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3685,
                        "end_line": 3718,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3722,
                        "end_line": 3729,
                        "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": 3732,
                        "end_line": 3740,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3744,
                        "end_line": 3758,
                        "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": 3761,
                        "end_line": 3805,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3809,
                        "end_line": 3812,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3815,
                        "end_line": 3822,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3826,
                        "end_line": 3833,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3836,
                        "end_line": 3856,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3859,
                        "end_line": 3881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3884,
                        "end_line": 3887,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3891,
                        "end_line": 3894,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3906,
                        "end_line": 3964,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3969,
                        "end_line": 3979,
                        "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": 3983,
                        "end_line": 4008,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4012,
                        "end_line": 4044,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4047,
                        "end_line": 4082,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4085,
                        "end_line": 4122,
                        "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": 4125,
                        "end_line": 4128,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4131,
                        "end_line": 4185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4364,
                        "end_line": 4389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4392,
                        "end_line": 4414,
                        "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": 4421,
                        "end_line": 4447,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4450,
                        "end_line": 4470,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4473,
                        "end_line": 4614,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4617,
                        "end_line": 4640,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4644,
                        "end_line": 4667,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4671,
                        "end_line": 4728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4732,
                        "end_line": 4739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4745,
                        "end_line": 4835,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4841,
                        "end_line": 4852,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4855,
                        "end_line": 4890,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4897,
                        "end_line": 4943,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4946,
                        "end_line": 5077,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5081,
                        "end_line": 5186,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5189,
                        "end_line": 5284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5287,
                        "end_line": 5308,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5312,
                        "end_line": 5374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5377,
                        "end_line": 5382,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5385,
                        "end_line": 5391,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5445,
                        "end_line": 5475,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5486,
                        "end_line": 5502,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5508,
                        "end_line": 5514,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5517,
                        "end_line": 5524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5527,
                        "end_line": 5534,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5540,
                        "end_line": 5623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5626,
                        "end_line": 5650,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5660,
                        "end_line": 5697,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5702,
                        "end_line": 5712,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5715,
                        "end_line": 5720,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5723,
                        "end_line": 5728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5732,
                        "end_line": 5735,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5739,
                        "end_line": 5787,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5790,
                        "end_line": 5843,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5847,
                        "end_line": 5966,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5970,
                        "end_line": 6002,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6005,
                        "end_line": 6047,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6051,
                        "end_line": 6173,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6186,
                        "end_line": 6228,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6233,
                        "end_line": 6237,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6302,
                        "end_line": 6363,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6371,
                        "end_line": 6386,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6392,
                        "end_line": 6461,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6465,
                        "end_line": 6501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6507,
                        "end_line": 6551,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6569,
                        "end_line": 6705,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6711,
                        "end_line": 6780,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6783,
                        "end_line": 6916,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6922,
                        "end_line": 6952,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6958,
                        "end_line": 6969,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6972,
                        "end_line": 6981,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6984,
                        "end_line": 7002,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "PyArray_New",
                        "long_name": "PyArray_New( PyTypeObject * subtype , int nd , intp * dims , int type_num , intp * strides , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3287,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5526,
                        "end_line": 5533,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5516,
                        "end_line": 5523,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5507,
                        "end_line": 5513,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 5548,
                "complexity": 1220,
                "token_count": 33221,
                "diff_parsed": {
                    "added": [
                        "\t\t\tself->ob_type->tp_free((PyObject *)self);",
                        "\t\t\tself->ob_type->tp_free((PyObject *)self);",
                        "\t\t\t\tself->ob_type->tp_free((PyObject *)self);",
                        "\t\t\t}",
                        "\t\t\tPyDimMem_FREE(self->dimensions);",
                        "\t\t\tself->ob_type->tp_free((PyObject *)self);",
                        "\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);",
                        "\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);",
                        "\t\t\t       ENSURECOPY | ENSUREARRAY);"
                    ],
                    "deleted": [
                        "\t\t\tPyObject_Del(self);",
                        "\t\t\tPyObject_Del(self);",
                        "\t\t\t\tPyObject_Del(self);",
                        "\t\t\t}",
                        "\t\t\tPyObject_Del(self);",
                        "\t\t\tif (self->dimensions != NULL)",
                        "\t\t\t\tPyDimMem_FREE(self->dimensions);",
                        "\t\t\t     max_depth, BEHAVED_FLAGS);",
                        "\t\t\t     max_depth, DEFAULT_FLAGS);",
                        "\t\t\t     ENSURECOPY);"
                    ]
                }
            },
            {
                "old_path": "scipy/f2py2e/capi_maps.py",
                "new_path": "scipy/f2py2e/capi_maps.py",
                "filename": "capi_maps.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -59,6 +59,27 @@\n             'complex_double':'PyArray_CDOUBLE',\n             'complex_long_double':'PyArray_CDOUBLE',   # forced casting\n             'string':'PyArray_CHAR'}\n+\n+#These new maps aren't used anyhere yet, but should be by default\n+#  unless building numeric or numarray extensions.\n+newc2capi_map={'double':'PyArray_DOUBLE',\n+            'float':'PyArray_FLOAT',\n+            'long_double':'PyArray_LONGDOUBLE',           \n+            'char':'PyArray_BYTE',\n+            'unsigned_char':'PyArray_UBYTE',\n+            'signed_char':'PyArray_BYTE',\n+            'short':'PyArray_SHORT',\n+            'unsigned_short':'PyArray_USHORT',\n+            'int':'PyArray_INT',\n+            'unsigned':'PyArray_UINT',\n+            'long':'PyArray_LONG',\n+            'unsigned_long':'PyArray_ULONG',\n+            'long_long':'PyArray_LONGLONG',               \n+            'unsigned_long_long':'Pyarray_ULONGLONG',\n+            'complex_float':'PyArray_CFLOAT',\n+            'complex_double':'PyArray_CDOUBLE',\n+            'complex_long_double':'PyArray_CDOUBLE', \n+            'string':'PyArray_STRING'}\n c2pycode_map={'double':'d',\n               'float':'f',\n               'long_double':'d',                       # forced casting\n@@ -76,6 +97,24 @@\n               'complex_long_double':'D',               # forced casting\n               'string':'c'\n               }\n+newc2pycode_map={'double':'d',\n+                 'float':'f',\n+                 'long_double':'g', \n+                 'char':'b',\n+                 'unsigned_char':'B',\n+                 'signed_char':'b',\n+                 'short':'h',\n+                 'unsigned_short':'H',\n+                 'int':'i',\n+                 'unsigned':'I',\n+                 'long':'l',\n+                 'unsigned_long':'L',\n+                 'long_long':'q',                \n+                 'unsigned_long_long':'Q',\n+                 'complex_float':'F',\n+                 'complex_double':'D',\n+                 'complex_long_double':'G',   \n+                 'string':'S'}\n c2buildvalue_map={'double':'d',\n                   'float':'f',\n                   'char':'b',\n@@ -88,12 +127,16 @@\n                   'complex_double':'N',\n                   'complex_long_double':'N',\n                   'string':'z'}\n-f2cmap_all={'real':{'':'float','4':'float','8':'double','16':'long_double'},\n+f2cmap_all={'real':{'':'float','4':'float','8':'double','12':'long_double','16':'long_double'},\n             'integer':{'':'int','1':'signed_char','2':'short','4':'int','8':'long_long',\n                        '-1':'unsigned_char','-2':'unsigned_short','-4':'unsigned',\n                        '-8':'unsigned_long_long'},\n-            'complex':{'':'complex_float','8':'complex_float','16':'complex_double','32':'complex_long_double'},\n-            'complexkind':{'':'complex_float','4':'complex_float','8':'complex_double','16':'complex_long_double'},\n+            'complex':{'':'complex_float','8':'complex_float',\n+                       '16':'complex_double','24':'complex_long_double',\n+                       '32':'complex_long_double'},\n+            'complexkind':{'':'complex_float','4':'complex_float',\n+                           '8':'complex_double','12':'complex_long_double',\n+                           '16':'complex_long_double'},\n             'logical':{'':'int','1':'char','2':'short','4':'int','8':'long_long'},\n             'double complex':{'':'complex_double'},\n             'double precision':{'':'double'},\n",
                "added_lines": 46,
                "deleted_lines": 3,
                "source_code": "#!/usr/bin/env python\n\"\"\"\n\nCopyright 1999,2000 Pearu Peterson all rights reserved,\nPearu Peterson <pearu@ioc.ee>          \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 10:57:33 $\nPearu Peterson\n\"\"\"\n\n__version__ = \"$Revision: 1.60 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport string,copy,re,os\nfrom auxfuncs import *\nfrom crackfortran import markoutercomma\nimport cb_rules\n\ndepargs=[]\nlcb_map={}\nlcb2_map={}\n# forced casting: mainly caused by the fact that Python or Numeric\n#                 C/APIs do not support the corresponding C types.\nc2py_map={'double':'float',\n          'float':'float',                          # forced casting\n          'long_double':'float',                    # forced casting\n          'char':'int',                             # forced casting\n          'signed_char':'int',                      # forced casting\n          'unsigned_char':'int',                    # forced casting\n          'short':'int',                            # forced casting\n          'unsigned_short':'int',                   # forced casting\n          'int':'int',                              # (forced casting)\n          'long':'int',\n          'long_long':'long',\n          'unsigned':'int',                         # forced casting\n          'complex_float':'complex',                # forced casting\n          'complex_double':'complex',\n          'complex_long_double':'complex',          # forced casting\n          'string':'string',\n          }\nc2capi_map={'double':'PyArray_DOUBLE',\n            'float':'PyArray_FLOAT',\n            'long_double':'PyArray_DOUBLE',           # forced casting\n            'char':'PyArray_CHAR',\n            'unsigned_char':'PyArray_UBYTE',\n            'signed_char':'PyArray_SBYTE',\n            'short':'PyArray_SHORT',\n            'unsigned_short':'PyArray_USHORT',\n            'int':'PyArray_INT',\n            'unsigned':'PyArray_UINT',\n            'long':'PyArray_LONG',\n            'long_long':'PyArray_LONG',                # forced casting\n            'complex_float':'PyArray_CFLOAT',\n            'complex_double':'PyArray_CDOUBLE',\n            'complex_long_double':'PyArray_CDOUBLE',   # forced casting\n            'string':'PyArray_CHAR'}\n\n#These new maps aren't used anyhere yet, but should be by default\n#  unless building numeric or numarray extensions.\nnewc2capi_map={'double':'PyArray_DOUBLE',\n            'float':'PyArray_FLOAT',\n            'long_double':'PyArray_LONGDOUBLE',           \n            'char':'PyArray_BYTE',\n            'unsigned_char':'PyArray_UBYTE',\n            'signed_char':'PyArray_BYTE',\n            'short':'PyArray_SHORT',\n            'unsigned_short':'PyArray_USHORT',\n            'int':'PyArray_INT',\n            'unsigned':'PyArray_UINT',\n            'long':'PyArray_LONG',\n            'unsigned_long':'PyArray_ULONG',\n            'long_long':'PyArray_LONGLONG',               \n            'unsigned_long_long':'Pyarray_ULONGLONG',\n            'complex_float':'PyArray_CFLOAT',\n            'complex_double':'PyArray_CDOUBLE',\n            'complex_long_double':'PyArray_CDOUBLE', \n            'string':'PyArray_STRING'}\nc2pycode_map={'double':'d',\n              'float':'f',\n              'long_double':'d',                       # forced casting\n              'char':'1',\n              'signed_char':'1',\n              'unsigned_char':'b',\n              'short':'s',\n              'unsigned_short':'w',\n              'int':'i',\n              'unsigned':'u',\n              'long':'l',\n              'long_long':'L',\n              'complex_float':'F',\n              'complex_double':'D',\n              'complex_long_double':'D',               # forced casting\n              'string':'c'\n              }\nnewc2pycode_map={'double':'d',\n                 'float':'f',\n                 'long_double':'g', \n                 'char':'b',\n                 'unsigned_char':'B',\n                 'signed_char':'b',\n                 'short':'h',\n                 'unsigned_short':'H',\n                 'int':'i',\n                 'unsigned':'I',\n                 'long':'l',\n                 'unsigned_long':'L',\n                 'long_long':'q',                \n                 'unsigned_long_long':'Q',\n                 'complex_float':'F',\n                 'complex_double':'D',\n                 'complex_long_double':'G',   \n                 'string':'S'}\nc2buildvalue_map={'double':'d',\n                  'float':'f',\n                  'char':'b',\n                  'signed_char':'b',\n                  'short':'h',\n                  'int':'i',\n                  'long':'l',\n                  'long_long':'L',\n                  'complex_float':'N',\n                  'complex_double':'N',\n                  'complex_long_double':'N',\n                  'string':'z'}\nf2cmap_all={'real':{'':'float','4':'float','8':'double','12':'long_double','16':'long_double'},\n            'integer':{'':'int','1':'signed_char','2':'short','4':'int','8':'long_long',\n                       '-1':'unsigned_char','-2':'unsigned_short','-4':'unsigned',\n                       '-8':'unsigned_long_long'},\n            'complex':{'':'complex_float','8':'complex_float',\n                       '16':'complex_double','24':'complex_long_double',\n                       '32':'complex_long_double'},\n            'complexkind':{'':'complex_float','4':'complex_float',\n                           '8':'complex_double','12':'complex_long_double',\n                           '16':'complex_long_double'},\n            'logical':{'':'int','1':'char','2':'short','4':'int','8':'long_long'},\n            'double complex':{'':'complex_double'},\n            'double precision':{'':'double'},\n            'byte':{'':'char'},\n            'character':{'':'string'}\n            }\n\nif os.path.isfile('.f2py_f2cmap'):\n    # User defined additions to f2cmap_all.\n    # .f2py_f2cmap must contain a dictionary of dictionaries, only.\n    # For example, {'real':{'low':'float'}} means that Fortran 'real(low)' is\n    # interpreted as C 'float'.\n    # This feature is useful for F90/95 users if they use PARAMETERSs\n    # in type specifications.\n    try:\n        outmess('Reading .f2py_f2cmap ...\\n')\n        f = open('.f2py_f2cmap','r')\n        d = eval(f.read(),{},{})\n        f.close()\n        for k,d1 in d.items():\n            for k1 in d1.keys():\n                d1[string.lower(k1)] = d1[k1]\n            d[string.lower(k)] = d[k]\n        for k in d.keys():\n            if not f2cmap_all.has_key(k): f2cmap_all[k]={}\n            for k1 in d[k].keys():\n                if c2py_map.has_key(d[k][k1]):\n                    if f2cmap_all[k].has_key(k1):\n                        outmess(\"\\tWarning: redefinition of {'%s':{'%s':'%s'->'%s'}}\\n\"%(k,k1,f2cmap_all[k][k1],d[k][k1]))\n                    f2cmap_all[k][k1] = d[k][k1]\n                    outmess('\\tMapping \"%s(kind=%s)\" to \"%s\"\\n' % (k,k1,d[k][k1]))\n                else:\n                    errmess(\"\\tIgnoring map {'%s':{'%s':'%s'}}: '%s' must be in %s\\n\"%(k,k1,d[k][k1],d[k][k1],c2py_map.keys()))\n        outmess('Succesfully applied user defined changes from .f2py_f2cmap\\n')\n    except:\n        errmess('Failed to apply user defined changes from .f2py_f2cmap. Skipping.\\n')\ncformat_map={'double':'%g',\n             'float':'%g',\n             'long_double':'%Lg',\n             'char':'%d',\n             'signed_char':'%d',\n             'unsigned_char':'%hhu',\n             'short':'%hd',\n             'unsigned_short':'%hu',\n             'int':'%d',\n             'unsigned':'%u',\n             'long':'%ld',\n             'unsigned_long':'%lu',\n             'long_long':'%ld',\n             'complex_float':'(%g,%g)',\n             'complex_double':'(%g,%g)',\n             'complex_long_double':'(%Lg,%Lg)',\n             'string':'%s',\n             }\n\n############### Auxiliary functions \ndef getctype(var):\n    \"\"\"\n    Determines C type\n    \"\"\"\n    ctype='void'\n    if isfunction(var):\n        if var.has_key('result'): a=var['result']\n        else: a=var['name']\n        if var['vars'].has_key(a): return getctype(var['vars'][a])\n        else: errmess('getctype: function %s has no return value?!\\n'%a)\n    elif issubroutine(var):\n        return ctype\n    elif var.has_key('typespec') and f2cmap_all.has_key(string.lower(var['typespec'])):\n        typespec = string.lower(var['typespec'])\n        f2cmap=f2cmap_all[typespec]\n        ctype=f2cmap[''] # default type\n        if var.has_key('kindselector'):\n            if var['kindselector'].has_key('*'):\n                try:\n                    ctype=f2cmap[var['kindselector']['*']]\n                except KeyError:\n                    errmess('getctype: \"%s %s %s\" not supported.\\n'%(var['typespec'],'*',var['kindselector']['*']))\n            elif var['kindselector'].has_key('kind'):\n                if f2cmap_all.has_key(typespec+'kind'):\n                    f2cmap=f2cmap_all[typespec+'kind']\n                try:\n                    ctype=f2cmap[var['kindselector']['kind']]\n                except KeyError:\n                    if f2cmap_all.has_key(typespec):\n                        f2cmap=f2cmap_all[typespec]\n                    try:\n                        ctype=f2cmap[str(var['kindselector']['kind'])]\n                    except KeyError:\n                        errmess('getctype: \"%s(kind=%s)\" not supported (use .f2py_f2cmap).\\n'\\\n                                %(typespec,var['kindselector']['kind']))\n\n    else:\n        if not isexternal(var):\n            errmess('getctype: No C-type found in \"%s\", assuming void.\\n'%var)\n    return ctype\ndef getstrlength(var):\n    if isstringfunction(var):\n        if var.has_key('result'): a=var['result']\n        else: a=var['name']\n        if var['vars'].has_key(a): return getstrlength(var['vars'][a])\n        else: errmess('getstrlength: function %s has no return value?!\\n'%a)\n    if not isstring(var):\n        errmess('getstrlength: expected a signature of a string but got: %s\\n'%(`var`))\n    len='1'\n    if var.has_key('charselector'):\n        a=var['charselector']\n        if a.has_key('*'): len=a['*']\n        elif a.has_key('len'): len=a['len']\n    if re.match(r'\\(\\s*([*]|[:])\\s*\\)',len) or re.match(r'([*]|[:])',len): \n    #if len in ['(*)','*','(:)',':']:\n        if isintent_hide(var):\n            errmess('getstrlength:intent(hide): expected a string with defined length but got: %s\\n'%(`var`))\n        len='-1'\n    return len\ndef getarrdims(a,var,verbose=0):\n    global depargs\n    ret={}\n    if isstring(var) and not isarray(var):\n        ret['dims']=getstrlength(var)\n        ret['size']=ret['dims']\n        ret['rank']='1'\n    elif isscalar(var):\n        ret['size']='1'\n        ret['rank']='0'\n        ret['dims']=''\n    elif isarray(var):\n#         if not isintent_c(var):\n#             var['dimension'].reverse()\n        dim=copy.copy(var['dimension'])\n        ret['size']=string.join(dim,'*')\n        try: ret['size']=`eval(ret['size'])`\n        except: pass\n        ret['dims']=string.join(dim,',')\n        ret['rank']=`len(dim)`\n        ret['rank*[-1]']=`len(dim)*[-1]`[1:-1]\n        for i in range(len(dim)): # solve dim for dependecies\n            v=[]\n            if dim[i] in depargs: v=[dim[i]]\n            else:\n                for va in depargs:\n                    if re.match(r'.*?\\b%s\\b.*'%va,dim[i]):\n                        v.append(va)\n            for va in v:\n                if depargs.index(va)>depargs.index(a):\n                    dim[i]='*'\n                    break\n        ret['setdims'],i='',-1\n        for d in dim:\n            i=i+1\n            if d not in ['*',':','(*)','(:)']:\n                ret['setdims']='%s#varname#_Dims[%d]=%s,'%(ret['setdims'],i,d)\n        if ret['setdims']: ret['setdims']=ret['setdims'][:-1]\n        ret['cbsetdims'],i='',-1\n        for d in var['dimension']:\n            i=i+1\n            if d not in ['*',':','(*)','(:)']:\n                ret['cbsetdims']='%s#varname#_Dims[%d]=%s,'%(ret['cbsetdims'],i,d)\n            elif verbose :\n                errmess('getarrdims: If in call-back function: array argument %s must have bounded dimensions: got %s\\n'%(`a`,`d`))\n        if ret['cbsetdims']: ret['cbsetdims']=ret['cbsetdims'][:-1]\n#         if not isintent_c(var):\n#             var['dimension'].reverse()\n    return ret\ndef getpydocsign(a,var):\n    global lcb_map\n    if isfunction(var):\n        if var.has_key('result'): af=var['result']\n        else: af=var['name']\n        if var['vars'].has_key(af): return getpydocsign(af,var['vars'][af])\n        else: errmess('getctype: function %s has no return value?!\\n'%af)\n        return '',''\n    sig,sigout=a,a\n    opt=''\n    if isintent_in(var): opt='input'\n    elif isintent_inout(var): opt='in/output'\n    out_a = a\n    if isintent_out(var):\n        for k in var['intent']:\n            if k[:4]=='out=':\n                out_a = k[4:]\n                break\n    init=''\n    ctype=getctype(var)\n    \n    if hasinitvalue(var):\n        init,showinit=getinit(a,var)\n        init='= %s'%(showinit)\n    if isscalar(var):\n        if isintent_inout(var):\n            sig='%s :%s %s rank-0 array(%s,\\'%s\\')'%(a,init,opt,c2py_map[ctype],\n                              c2pycode_map[ctype],)\n        else:\n            sig='%s :%s %s %s'%(a,init,opt,c2py_map[ctype])\n        sigout='%s : %s'%(out_a,c2py_map[ctype])\n    elif isstring(var):\n        if isintent_inout(var):\n            sig='%s :%s %s rank-0 array(string(len=%s),\\'c\\')'%(a,init,opt,getstrlength(var))\n        else:\n            sig='%s :%s %s string(len=%s)'%(a,init,opt,getstrlength(var))\n        sigout='%s : string(len=%s)'%(out_a,getstrlength(var))\n    elif isarray(var):\n        dim=var['dimension']\n        rank=`len(dim)`\n        sig='%s :%s %s rank-%s array(\\'%s\\') with bounds (%s)'%(a,init,opt,rank,\n                                             c2pycode_map[ctype],\n                                             string.join(dim,','))\n        if a==out_a:\n            sigout='%s : rank-%s array(\\'%s\\') with bounds (%s)'\\\n                    %(a,rank,c2pycode_map[ctype],string.join(dim,','))\n        else:\n            sigout='%s : rank-%s array(\\'%s\\') with bounds (%s) and %s storage'\\\n                    %(out_a,rank,c2pycode_map[ctype],string.join(dim,','),a)\n    elif isexternal(var):\n        ua=''\n        if lcb_map.has_key(a) and lcb2_map.has_key(lcb_map[a]) and lcb2_map[lcb_map[a]].has_key('argname'):\n            ua=lcb2_map[lcb_map[a]]['argname']\n            if not ua==a: ua=' => %s'%ua\n            else: ua=''\n        sig='%s : call-back function%s'%(a,ua)\n        sigout=sig\n    else:\n        errmess('getpydocsign: Could not resolve docsignature for \"%s\".\\\\n'%a)\n    return sig,sigout\ndef getarrdocsign(a,var):\n    ctype=getctype(var)\n    if isstring(var) and (not isarray(var)):\n        sig='%s : rank-0 array(string(len=%s),\\'c\\')'%(a,getstrlength(var))\n    elif isscalar(var):\n        sig='%s : rank-0 array(%s,\\'%s\\')'%(a,c2py_map[ctype],\n                                            c2pycode_map[ctype],)\n    elif isarray(var):\n        dim=var['dimension']\n        rank=`len(dim)`\n        sig='%s : rank-%s array(\\'%s\\') with bounds (%s)'%(a,rank,\n                                                           c2pycode_map[ctype],\n                                                           string.join(dim,','))\n    return sig\n\ndef getinit(a,var):\n    if isstring(var): init,showinit='\"\"',\"''\"\n    else: init,showinit='',''\n    if hasinitvalue(var):\n        init=var['=']\n        showinit=init\n        if iscomplex(var) or iscomplexarray(var):\n\t    ret={}\n            \n            try:\n                v = var[\"=\"]\n                if ',' in v:\n                    ret['init.r'],ret['init.i']=string.split(markoutercomma(v[1:-1]),'@,@')\n                else:\n                    v = eval(v,{},{})\n                    ret['init.r'],ret['init.i']=str(v.real),str(v.imag)\n            except: raise 'sign2map: expected complex number `(r,i)\\' but got `%s\\' as initial value of %s.'%(init,`a`)\n            if isarray(var):\n                init='(capi_c.r=%s,capi_c.i=%s,capi_c)'%(ret['init.r'],ret['init.i'])\n        elif isstring(var):\n            if not init: init,showinit='\"\"',\"''\"\n            if init[0]==\"'\":\n                init='\"%s\"'%(string.replace(init[1:-1],'\"','\\\\\"'))\n            if init[0]=='\"': showinit=\"'%s'\"%(init[1:-1])\n    return init,showinit\n\ndef sign2map(a,var):\n    \"\"\"\n    varname,ctype,atype\n    init,init.r,init.i,pytype\n    vardebuginfo,vardebugshowvalue,varshowvalue\n    varrfromat\n    intent\n    \"\"\"\n    global lcb_map,cb_map\n    out_a = a\n    if isintent_out(var):\n        for k in var['intent']:\n            if k[:4]=='out=':\n                out_a = k[4:]\n                break\n    ret={'varname':a,'outvarname':out_a}\n    ret['ctype']=getctype(var)\n    intent_flags = []\n    for f,s in isintent_dict.items():\n        if f(var): intent_flags.append('F2PY_%s'%s)\n    if intent_flags:\n        #XXX: Evaluate intent_flags here.\n        ret['intent'] = string.join(intent_flags,'|')\n    else:\n        ret['intent'] = 'F2PY_INTENT_IN'\n    if isarray(var): ret['varrformat']='N'\n    elif c2buildvalue_map.has_key(ret['ctype']):\n        ret['varrformat']=c2buildvalue_map[ret['ctype']]\n    else: ret['varrformat']='O'\n    ret['init'],ret['showinit']=getinit(a,var)\n    if hasinitvalue(var) and iscomplex(var) and not isarray(var):\n\tret['init.r'],ret['init.i'] = string.split(markoutercomma(ret['init'][1:-1]),'@,@')\n    if isexternal(var):\n        ret['cbnamekey']=a\n        if lcb_map.has_key(a):\n            ret['cbname']=lcb_map[a]\n            ret['maxnofargs']=lcb2_map[lcb_map[a]]['maxnofargs']\n            ret['nofoptargs']=lcb2_map[lcb_map[a]]['nofoptargs']\n            ret['cbdocstr']=lcb2_map[lcb_map[a]]['docstr']\n            ret['cblatexdocstr']=lcb2_map[lcb_map[a]]['latexdocstr']\n        else:\n            ret['cbname']=a\n            errmess('sign2map: Confused: external %s is not in lcb_map%s.\\n'%(a,lcb_map.keys()))\n    if isstring(var):\n        ret['length']=getstrlength(var)\n    if isarray(var):\n        ret=dictappend(ret,getarrdims(a,var))\n        dim=copy.copy(var['dimension'])\n    if c2capi_map.has_key(ret['ctype']): ret['atype']=c2capi_map[ret['ctype']]\n    # Debug info\n    if debugcapi(var):\n        il=[isintent_in,'input',isintent_out,'output',\n            isintent_inout,'inoutput',isrequired,'required',\n            isoptional,'optional',isintent_hide,'hidden',\n            iscomplex,'complex scalar',\n            l_and(isscalar,l_not(iscomplex)),'scalar',\n            isstring,'string',isarray,'array',\n            iscomplexarray,'complex array',isstringarray,'string array',\n            iscomplexfunction,'complex function',\n            l_and(isfunction,l_not(iscomplexfunction)),'function',\n            isexternal,'callback',\n            isintent_callback,'callback',\n            isintent_aux,'auxiliary',\n            #ismutable,'mutable',l_not(ismutable),'immutable',\n            ]\n        rl=[]\n        for i in range(0,len(il),2):\n            if il[i](var): rl.append(il[i+1])\n        if isstring(var):\n            rl.append('slen(%s)=%s'%(a,ret['length']))\n        if isarray(var):\n#             if not isintent_c(var):\n#                 var['dimension'].reverse()\n            ddim=string.join(map(lambda x,y:'%s|%s'%(x,y),var['dimension'],dim),',')\n            rl.append('dims(%s)'%ddim)\n#             if not isintent_c(var):\n#                 var['dimension'].reverse()\n        if isexternal(var):\n            ret['vardebuginfo']='debug-capi:%s=>%s:%s'%(a,ret['cbname'],string.join(rl,','))\n        else:\n            ret['vardebuginfo']='debug-capi:%s %s=%s:%s'%(ret['ctype'],a,ret['showinit'],string.join(rl,','))\n        if isscalar(var):\n            if cformat_map.has_key(ret['ctype']):\n                ret['vardebugshowvalue']='debug-capi:%s=%s'%(a,cformat_map[ret['ctype']])\n        if isstring(var):\n            ret['vardebugshowvalue']='debug-capi:slen(%s)=%%d %s=\\\\\"%%s\\\\\"'%(a,a)\n        if isexternal(var):\n            ret['vardebugshowvalue']='debug-capi:%s=%%p'%(a)\n    if cformat_map.has_key(ret['ctype']):\n        ret['varshowvalue']='#name#:%s=%s'%(a,cformat_map[ret['ctype']])\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isstring(var):\n        ret['varshowvalue']='#name#:slen(%s)=%%d %s=\\\\\"%%s\\\\\"'%(a,a)\n    ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,var)\n    if hasnote(var):\n        ret['note']=var['note']\n    return ret\n\ndef routsign2map(rout):\n    \"\"\"\n    name,NAME,begintitle,endtitle\n    rname,ctype,rformat\n    routdebugshowvalue\n    \"\"\"\n    global lcb_map\n    name = rout['name']\n    fname = getfortranname(rout)\n    ret={'name':name,\n         'texname':string.replace(name,'_','\\\\_'),\n         'name_lower':string.lower(name),\n         'NAME':string.upper(name),\n         'begintitle':gentitle(name),\n         'endtitle':gentitle('end of %s'%name),\n         'fortranname':fname,\n         'FORTRANNAME':string.upper(fname),\n         'callstatement':getcallstatement(rout) or '',\n         'usercode':getusercode(rout) or '',\n         'usercode1':getusercode1(rout) or '',\n         }\n    if '_' in fname:\n        ret['F_FUNC'] = 'F_FUNC_US'\n    else:\n        ret['F_FUNC'] = 'F_FUNC'\n    if '_' in name:\n        ret['F_WRAPPEDFUNC'] = 'F_WRAPPEDFUNC_US'\n    else:\n        ret['F_WRAPPEDFUNC'] = 'F_WRAPPEDFUNC'\n    lcb_map={}\n    if rout.has_key('use'):\n        for u in rout['use'].keys():\n            if cb_rules.cb_map.has_key(u):\n                for un in cb_rules.cb_map[u]:\n                    ln=un[0]\n                    if rout['use'][u].has_key('map'):\n                        for k in rout['use'][u]['map'].keys():\n                            if rout['use'][u]['map'][k]==un[0]: ln=k;break\n                    lcb_map[ln]=un[1]\n            #else:\n            #    errmess('routsign2map: cb_map does not contain module \"%s\" used in \"use\" statement.\\n'%(u))\n    elif rout.has_key('externals') and rout['externals']:\n        errmess('routsign2map: Confused: function %s has externals %s but no \"use\" statement.\\n'%(ret['name'],`rout['externals']`))\n    ret['callprotoargument'] = getcallprotoargument(rout,lcb_map) or ''\n    if isfunction(rout):\n        if rout.has_key('result'): a=rout['result']\n        else: a=rout['name']\n        ret['rname']=a\n        ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,rout)\n        ret['ctype']=getctype(rout['vars'][a])\n        if hasresultnote(rout):\n            ret['resultnote']=rout['vars'][a]['note']\n            rout['vars'][a]['note']=['See elsewhere.']\n        if c2buildvalue_map.has_key(ret['ctype']):\n            ret['rformat']=c2buildvalue_map[ret['ctype']]\n        else: \n            ret['rformat']='O'\n            errmess('routsign2map: no c2buildvalue key for type %s\\n'%(`ret['ctype']`))\n        if debugcapi(rout):\n            if cformat_map.has_key(ret['ctype']):\n                ret['routdebugshowvalue']='debug-capi:%s=%s'%(a,cformat_map[ret['ctype']])\n            if isstringfunction(rout):\n                ret['routdebugshowvalue']='debug-capi:slen(%s)=%%d %s=\\\\\"%%s\\\\\"'%(a,a)\n        if isstringfunction(rout):\n            ret['rlength']=getstrlength(rout['vars'][a])\n            if ret['rlength']=='-1':\n                errmess('routsign2map: expected explicit specification of the length of the string returned by the fortran function %s; taking 10.\\n'%(`rout['name']`))\n                ret['rlength']='10'\n    if hasnote(rout):\n        ret['note']=rout['note']\n        rout['note']=['See elsewhere.']\n    return ret\n\ndef modsign2map(m):\n    \"\"\"\n    modulename\n    \"\"\"\n    if ismodule(m):\n        ret={'f90modulename':m['name'],\n             'F90MODULENAME':string.upper(m['name']),\n             'texf90modulename':string.replace(m['name'],'_','\\\\_')}\n    else:\n        ret={'modulename':m['name'],\n             'MODULENAME':string.upper(m['name']),\n             'texmodulename':string.replace(m['name'],'_','\\\\_')}\n    ret['restdoc'] = getrestdoc(m) or []\n    if hasnote(m):\n        ret['note']=m['note']\n        #m['note']=['See elsewhere.']\n    ret['usercode'] = getusercode(m) or ''\n    ret['usercode1'] = getusercode1(m) or ''\n    if m['body']:\n        ret['interface_usercode'] = getusercode(m['body'][0]) or ''\n    else:\n        ret['interface_usercode'] = ''\n    ret['pymethoddef'] = getpymethoddef(m) or ''\n    return ret\n\ndef cb_sign2map(a,var):\n    ret={'varname':a}\n    ret['ctype']=getctype(var)\n    if c2capi_map.has_key(ret['ctype']):\n        ret['atype']=c2capi_map[ret['ctype']]\n    if cformat_map.has_key(ret['ctype']):\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isarray(var):\n        ret=dictappend(ret,getarrdims(a,var))\n    ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,var)\n    if hasnote(var):\n        ret['note']=var['note']\n        var['note']=['See elsewhere.']\n    return ret\n\ndef cb_routsign2map(rout,um):\n    \"\"\"\n    name,begintitle,endtitle,argname\n    ctype,rctype,maxnofargs,nofoptargs,returncptr\n    \"\"\"\n    ret={'name':'cb_%s_in_%s'%(rout['name'],um),\n         'returncptr':''}\n    if isintent_callback(rout):\n        if '_' in rout['name']:\n            F_FUNC='F_FUNC_US'\n        else:\n            F_FUNC='F_FUNC'\n        ret['callbackname'] = '%s(%s,%s)' \\\n                              % (F_FUNC,\n                                 rout['name'].lower(),\n                                 rout['name'].upper(),\n                                 )\n        ret['static'] = 'extern'\n    else:\n        ret['callbackname'] = ret['name']\n        ret['static'] = 'static'\n    ret['argname']=rout['name']\n    ret['begintitle']=gentitle(ret['name'])\n    ret['endtitle']=gentitle('end of %s'%ret['name'])\n    ret['ctype']=getctype(rout)\n    ret['rctype']='void'\n    if ret['ctype']=='string': ret['rctype']='void'\n    else:\n        ret['rctype']=ret['ctype']\n    if ret['rctype']!='void':\n        if iscomplexfunction(rout):\n            ret['returncptr'] = \"\"\"\n#ifdef F2PY_CB_RETURNCOMPLEX\nreturn_value=\n#endif\n\"\"\"\n        else:\n            ret['returncptr'] = 'return_value='\n    if cformat_map.has_key(ret['ctype']):\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isstringfunction(rout):\n        ret['strlength']=getstrlength(rout)\n    if isfunction(rout):\n        if rout.has_key('result'): a=rout['result']\n        else: a=rout['name']\n        if hasnote(rout['vars'][a]):\n            ret['note']=rout['vars'][a]['note']\n            rout['vars'][a]['note']=['See elsewhere.']\n        ret['rname']=a\n        ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,rout)\n        if iscomplexfunction(rout):\n            ret['rctype']=\"\"\"\n#ifdef F2PY_CB_RETURNCOMPLEX\n#ctype#            \n#else\nvoid\n#endif\n\"\"\"\n    else:\n        if hasnote(rout):\n            ret['note']=rout['note']\n            rout['note']=['See elsewhere.']\n    nofargs=0\n    nofoptargs=0\n    if rout.has_key('args') and rout.has_key('vars'):\n        for a in rout['args']:\n            var=rout['vars'][a]\n            if l_or(isintent_in,isintent_inout)(var):\n                nofargs=nofargs+1\n                if isoptional(var):\n                    nofoptargs=nofoptargs+1\n    ret['maxnofargs']=`nofargs`\n    ret['nofoptargs']=`nofoptargs`\n    if hasnote(rout) and isfunction(rout) and rout.has_key('result'):\n        ret['routnote']=rout['note']\n        rout['note']=['See elsewhere.']\n    return ret\n\ndef common_sign2map(a,var): # obsolute\n    ret={'varname':a}\n    ret['ctype']=getctype(var)\n    if isstringarray(var): ret['ctype']='char'\n    if c2capi_map.has_key(ret['ctype']):\n        ret['atype']=c2capi_map[ret['ctype']]\n    if cformat_map.has_key(ret['ctype']):\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isarray(var):\n        ret=dictappend(ret,getarrdims(a,var))\n    elif isstring(var):\n        ret['size']=getstrlength(var)\n        ret['rank']='1'\n    ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,var)\n    if hasnote(var):\n        ret['note']=var['note']\n        var['note']=['See elsewhere.']\n    ret['arrdocstr']=getarrdocsign(a,var) # for strings this returns 0-rank but actually is 1-rank\n    return ret\n\n\n",
                "source_code_before": "#!/usr/bin/env python\n\"\"\"\n\nCopyright 1999,2000 Pearu Peterson all rights reserved,\nPearu Peterson <pearu@ioc.ee>          \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 10:57:33 $\nPearu Peterson\n\"\"\"\n\n__version__ = \"$Revision: 1.60 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport string,copy,re,os\nfrom auxfuncs import *\nfrom crackfortran import markoutercomma\nimport cb_rules\n\ndepargs=[]\nlcb_map={}\nlcb2_map={}\n# forced casting: mainly caused by the fact that Python or Numeric\n#                 C/APIs do not support the corresponding C types.\nc2py_map={'double':'float',\n          'float':'float',                          # forced casting\n          'long_double':'float',                    # forced casting\n          'char':'int',                             # forced casting\n          'signed_char':'int',                      # forced casting\n          'unsigned_char':'int',                    # forced casting\n          'short':'int',                            # forced casting\n          'unsigned_short':'int',                   # forced casting\n          'int':'int',                              # (forced casting)\n          'long':'int',\n          'long_long':'long',\n          'unsigned':'int',                         # forced casting\n          'complex_float':'complex',                # forced casting\n          'complex_double':'complex',\n          'complex_long_double':'complex',          # forced casting\n          'string':'string',\n          }\nc2capi_map={'double':'PyArray_DOUBLE',\n            'float':'PyArray_FLOAT',\n            'long_double':'PyArray_DOUBLE',           # forced casting\n            'char':'PyArray_CHAR',\n            'unsigned_char':'PyArray_UBYTE',\n            'signed_char':'PyArray_SBYTE',\n            'short':'PyArray_SHORT',\n            'unsigned_short':'PyArray_USHORT',\n            'int':'PyArray_INT',\n            'unsigned':'PyArray_UINT',\n            'long':'PyArray_LONG',\n            'long_long':'PyArray_LONG',                # forced casting\n            'complex_float':'PyArray_CFLOAT',\n            'complex_double':'PyArray_CDOUBLE',\n            'complex_long_double':'PyArray_CDOUBLE',   # forced casting\n            'string':'PyArray_CHAR'}\nc2pycode_map={'double':'d',\n              'float':'f',\n              'long_double':'d',                       # forced casting\n              'char':'1',\n              'signed_char':'1',\n              'unsigned_char':'b',\n              'short':'s',\n              'unsigned_short':'w',\n              'int':'i',\n              'unsigned':'u',\n              'long':'l',\n              'long_long':'L',\n              'complex_float':'F',\n              'complex_double':'D',\n              'complex_long_double':'D',               # forced casting\n              'string':'c'\n              }\nc2buildvalue_map={'double':'d',\n                  'float':'f',\n                  'char':'b',\n                  'signed_char':'b',\n                  'short':'h',\n                  'int':'i',\n                  'long':'l',\n                  'long_long':'L',\n                  'complex_float':'N',\n                  'complex_double':'N',\n                  'complex_long_double':'N',\n                  'string':'z'}\nf2cmap_all={'real':{'':'float','4':'float','8':'double','16':'long_double'},\n            'integer':{'':'int','1':'signed_char','2':'short','4':'int','8':'long_long',\n                       '-1':'unsigned_char','-2':'unsigned_short','-4':'unsigned',\n                       '-8':'unsigned_long_long'},\n            'complex':{'':'complex_float','8':'complex_float','16':'complex_double','32':'complex_long_double'},\n            'complexkind':{'':'complex_float','4':'complex_float','8':'complex_double','16':'complex_long_double'},\n            'logical':{'':'int','1':'char','2':'short','4':'int','8':'long_long'},\n            'double complex':{'':'complex_double'},\n            'double precision':{'':'double'},\n            'byte':{'':'char'},\n            'character':{'':'string'}\n            }\n\nif os.path.isfile('.f2py_f2cmap'):\n    # User defined additions to f2cmap_all.\n    # .f2py_f2cmap must contain a dictionary of dictionaries, only.\n    # For example, {'real':{'low':'float'}} means that Fortran 'real(low)' is\n    # interpreted as C 'float'.\n    # This feature is useful for F90/95 users if they use PARAMETERSs\n    # in type specifications.\n    try:\n        outmess('Reading .f2py_f2cmap ...\\n')\n        f = open('.f2py_f2cmap','r')\n        d = eval(f.read(),{},{})\n        f.close()\n        for k,d1 in d.items():\n            for k1 in d1.keys():\n                d1[string.lower(k1)] = d1[k1]\n            d[string.lower(k)] = d[k]\n        for k in d.keys():\n            if not f2cmap_all.has_key(k): f2cmap_all[k]={}\n            for k1 in d[k].keys():\n                if c2py_map.has_key(d[k][k1]):\n                    if f2cmap_all[k].has_key(k1):\n                        outmess(\"\\tWarning: redefinition of {'%s':{'%s':'%s'->'%s'}}\\n\"%(k,k1,f2cmap_all[k][k1],d[k][k1]))\n                    f2cmap_all[k][k1] = d[k][k1]\n                    outmess('\\tMapping \"%s(kind=%s)\" to \"%s\"\\n' % (k,k1,d[k][k1]))\n                else:\n                    errmess(\"\\tIgnoring map {'%s':{'%s':'%s'}}: '%s' must be in %s\\n\"%(k,k1,d[k][k1],d[k][k1],c2py_map.keys()))\n        outmess('Succesfully applied user defined changes from .f2py_f2cmap\\n')\n    except:\n        errmess('Failed to apply user defined changes from .f2py_f2cmap. Skipping.\\n')\ncformat_map={'double':'%g',\n             'float':'%g',\n             'long_double':'%Lg',\n             'char':'%d',\n             'signed_char':'%d',\n             'unsigned_char':'%hhu',\n             'short':'%hd',\n             'unsigned_short':'%hu',\n             'int':'%d',\n             'unsigned':'%u',\n             'long':'%ld',\n             'unsigned_long':'%lu',\n             'long_long':'%ld',\n             'complex_float':'(%g,%g)',\n             'complex_double':'(%g,%g)',\n             'complex_long_double':'(%Lg,%Lg)',\n             'string':'%s',\n             }\n\n############### Auxiliary functions \ndef getctype(var):\n    \"\"\"\n    Determines C type\n    \"\"\"\n    ctype='void'\n    if isfunction(var):\n        if var.has_key('result'): a=var['result']\n        else: a=var['name']\n        if var['vars'].has_key(a): return getctype(var['vars'][a])\n        else: errmess('getctype: function %s has no return value?!\\n'%a)\n    elif issubroutine(var):\n        return ctype\n    elif var.has_key('typespec') and f2cmap_all.has_key(string.lower(var['typespec'])):\n        typespec = string.lower(var['typespec'])\n        f2cmap=f2cmap_all[typespec]\n        ctype=f2cmap[''] # default type\n        if var.has_key('kindselector'):\n            if var['kindselector'].has_key('*'):\n                try:\n                    ctype=f2cmap[var['kindselector']['*']]\n                except KeyError:\n                    errmess('getctype: \"%s %s %s\" not supported.\\n'%(var['typespec'],'*',var['kindselector']['*']))\n            elif var['kindselector'].has_key('kind'):\n                if f2cmap_all.has_key(typespec+'kind'):\n                    f2cmap=f2cmap_all[typespec+'kind']\n                try:\n                    ctype=f2cmap[var['kindselector']['kind']]\n                except KeyError:\n                    if f2cmap_all.has_key(typespec):\n                        f2cmap=f2cmap_all[typespec]\n                    try:\n                        ctype=f2cmap[str(var['kindselector']['kind'])]\n                    except KeyError:\n                        errmess('getctype: \"%s(kind=%s)\" not supported (use .f2py_f2cmap).\\n'\\\n                                %(typespec,var['kindselector']['kind']))\n\n    else:\n        if not isexternal(var):\n            errmess('getctype: No C-type found in \"%s\", assuming void.\\n'%var)\n    return ctype\ndef getstrlength(var):\n    if isstringfunction(var):\n        if var.has_key('result'): a=var['result']\n        else: a=var['name']\n        if var['vars'].has_key(a): return getstrlength(var['vars'][a])\n        else: errmess('getstrlength: function %s has no return value?!\\n'%a)\n    if not isstring(var):\n        errmess('getstrlength: expected a signature of a string but got: %s\\n'%(`var`))\n    len='1'\n    if var.has_key('charselector'):\n        a=var['charselector']\n        if a.has_key('*'): len=a['*']\n        elif a.has_key('len'): len=a['len']\n    if re.match(r'\\(\\s*([*]|[:])\\s*\\)',len) or re.match(r'([*]|[:])',len): \n    #if len in ['(*)','*','(:)',':']:\n        if isintent_hide(var):\n            errmess('getstrlength:intent(hide): expected a string with defined length but got: %s\\n'%(`var`))\n        len='-1'\n    return len\ndef getarrdims(a,var,verbose=0):\n    global depargs\n    ret={}\n    if isstring(var) and not isarray(var):\n        ret['dims']=getstrlength(var)\n        ret['size']=ret['dims']\n        ret['rank']='1'\n    elif isscalar(var):\n        ret['size']='1'\n        ret['rank']='0'\n        ret['dims']=''\n    elif isarray(var):\n#         if not isintent_c(var):\n#             var['dimension'].reverse()\n        dim=copy.copy(var['dimension'])\n        ret['size']=string.join(dim,'*')\n        try: ret['size']=`eval(ret['size'])`\n        except: pass\n        ret['dims']=string.join(dim,',')\n        ret['rank']=`len(dim)`\n        ret['rank*[-1]']=`len(dim)*[-1]`[1:-1]\n        for i in range(len(dim)): # solve dim for dependecies\n            v=[]\n            if dim[i] in depargs: v=[dim[i]]\n            else:\n                for va in depargs:\n                    if re.match(r'.*?\\b%s\\b.*'%va,dim[i]):\n                        v.append(va)\n            for va in v:\n                if depargs.index(va)>depargs.index(a):\n                    dim[i]='*'\n                    break\n        ret['setdims'],i='',-1\n        for d in dim:\n            i=i+1\n            if d not in ['*',':','(*)','(:)']:\n                ret['setdims']='%s#varname#_Dims[%d]=%s,'%(ret['setdims'],i,d)\n        if ret['setdims']: ret['setdims']=ret['setdims'][:-1]\n        ret['cbsetdims'],i='',-1\n        for d in var['dimension']:\n            i=i+1\n            if d not in ['*',':','(*)','(:)']:\n                ret['cbsetdims']='%s#varname#_Dims[%d]=%s,'%(ret['cbsetdims'],i,d)\n            elif verbose :\n                errmess('getarrdims: If in call-back function: array argument %s must have bounded dimensions: got %s\\n'%(`a`,`d`))\n        if ret['cbsetdims']: ret['cbsetdims']=ret['cbsetdims'][:-1]\n#         if not isintent_c(var):\n#             var['dimension'].reverse()\n    return ret\ndef getpydocsign(a,var):\n    global lcb_map\n    if isfunction(var):\n        if var.has_key('result'): af=var['result']\n        else: af=var['name']\n        if var['vars'].has_key(af): return getpydocsign(af,var['vars'][af])\n        else: errmess('getctype: function %s has no return value?!\\n'%af)\n        return '',''\n    sig,sigout=a,a\n    opt=''\n    if isintent_in(var): opt='input'\n    elif isintent_inout(var): opt='in/output'\n    out_a = a\n    if isintent_out(var):\n        for k in var['intent']:\n            if k[:4]=='out=':\n                out_a = k[4:]\n                break\n    init=''\n    ctype=getctype(var)\n    \n    if hasinitvalue(var):\n        init,showinit=getinit(a,var)\n        init='= %s'%(showinit)\n    if isscalar(var):\n        if isintent_inout(var):\n            sig='%s :%s %s rank-0 array(%s,\\'%s\\')'%(a,init,opt,c2py_map[ctype],\n                              c2pycode_map[ctype],)\n        else:\n            sig='%s :%s %s %s'%(a,init,opt,c2py_map[ctype])\n        sigout='%s : %s'%(out_a,c2py_map[ctype])\n    elif isstring(var):\n        if isintent_inout(var):\n            sig='%s :%s %s rank-0 array(string(len=%s),\\'c\\')'%(a,init,opt,getstrlength(var))\n        else:\n            sig='%s :%s %s string(len=%s)'%(a,init,opt,getstrlength(var))\n        sigout='%s : string(len=%s)'%(out_a,getstrlength(var))\n    elif isarray(var):\n        dim=var['dimension']\n        rank=`len(dim)`\n        sig='%s :%s %s rank-%s array(\\'%s\\') with bounds (%s)'%(a,init,opt,rank,\n                                             c2pycode_map[ctype],\n                                             string.join(dim,','))\n        if a==out_a:\n            sigout='%s : rank-%s array(\\'%s\\') with bounds (%s)'\\\n                    %(a,rank,c2pycode_map[ctype],string.join(dim,','))\n        else:\n            sigout='%s : rank-%s array(\\'%s\\') with bounds (%s) and %s storage'\\\n                    %(out_a,rank,c2pycode_map[ctype],string.join(dim,','),a)\n    elif isexternal(var):\n        ua=''\n        if lcb_map.has_key(a) and lcb2_map.has_key(lcb_map[a]) and lcb2_map[lcb_map[a]].has_key('argname'):\n            ua=lcb2_map[lcb_map[a]]['argname']\n            if not ua==a: ua=' => %s'%ua\n            else: ua=''\n        sig='%s : call-back function%s'%(a,ua)\n        sigout=sig\n    else:\n        errmess('getpydocsign: Could not resolve docsignature for \"%s\".\\\\n'%a)\n    return sig,sigout\ndef getarrdocsign(a,var):\n    ctype=getctype(var)\n    if isstring(var) and (not isarray(var)):\n        sig='%s : rank-0 array(string(len=%s),\\'c\\')'%(a,getstrlength(var))\n    elif isscalar(var):\n        sig='%s : rank-0 array(%s,\\'%s\\')'%(a,c2py_map[ctype],\n                                            c2pycode_map[ctype],)\n    elif isarray(var):\n        dim=var['dimension']\n        rank=`len(dim)`\n        sig='%s : rank-%s array(\\'%s\\') with bounds (%s)'%(a,rank,\n                                                           c2pycode_map[ctype],\n                                                           string.join(dim,','))\n    return sig\n\ndef getinit(a,var):\n    if isstring(var): init,showinit='\"\"',\"''\"\n    else: init,showinit='',''\n    if hasinitvalue(var):\n        init=var['=']\n        showinit=init\n        if iscomplex(var) or iscomplexarray(var):\n\t    ret={}\n            \n            try:\n                v = var[\"=\"]\n                if ',' in v:\n                    ret['init.r'],ret['init.i']=string.split(markoutercomma(v[1:-1]),'@,@')\n                else:\n                    v = eval(v,{},{})\n                    ret['init.r'],ret['init.i']=str(v.real),str(v.imag)\n            except: raise 'sign2map: expected complex number `(r,i)\\' but got `%s\\' as initial value of %s.'%(init,`a`)\n            if isarray(var):\n                init='(capi_c.r=%s,capi_c.i=%s,capi_c)'%(ret['init.r'],ret['init.i'])\n        elif isstring(var):\n            if not init: init,showinit='\"\"',\"''\"\n            if init[0]==\"'\":\n                init='\"%s\"'%(string.replace(init[1:-1],'\"','\\\\\"'))\n            if init[0]=='\"': showinit=\"'%s'\"%(init[1:-1])\n    return init,showinit\n\ndef sign2map(a,var):\n    \"\"\"\n    varname,ctype,atype\n    init,init.r,init.i,pytype\n    vardebuginfo,vardebugshowvalue,varshowvalue\n    varrfromat\n    intent\n    \"\"\"\n    global lcb_map,cb_map\n    out_a = a\n    if isintent_out(var):\n        for k in var['intent']:\n            if k[:4]=='out=':\n                out_a = k[4:]\n                break\n    ret={'varname':a,'outvarname':out_a}\n    ret['ctype']=getctype(var)\n    intent_flags = []\n    for f,s in isintent_dict.items():\n        if f(var): intent_flags.append('F2PY_%s'%s)\n    if intent_flags:\n        #XXX: Evaluate intent_flags here.\n        ret['intent'] = string.join(intent_flags,'|')\n    else:\n        ret['intent'] = 'F2PY_INTENT_IN'\n    if isarray(var): ret['varrformat']='N'\n    elif c2buildvalue_map.has_key(ret['ctype']):\n        ret['varrformat']=c2buildvalue_map[ret['ctype']]\n    else: ret['varrformat']='O'\n    ret['init'],ret['showinit']=getinit(a,var)\n    if hasinitvalue(var) and iscomplex(var) and not isarray(var):\n\tret['init.r'],ret['init.i'] = string.split(markoutercomma(ret['init'][1:-1]),'@,@')\n    if isexternal(var):\n        ret['cbnamekey']=a\n        if lcb_map.has_key(a):\n            ret['cbname']=lcb_map[a]\n            ret['maxnofargs']=lcb2_map[lcb_map[a]]['maxnofargs']\n            ret['nofoptargs']=lcb2_map[lcb_map[a]]['nofoptargs']\n            ret['cbdocstr']=lcb2_map[lcb_map[a]]['docstr']\n            ret['cblatexdocstr']=lcb2_map[lcb_map[a]]['latexdocstr']\n        else:\n            ret['cbname']=a\n            errmess('sign2map: Confused: external %s is not in lcb_map%s.\\n'%(a,lcb_map.keys()))\n    if isstring(var):\n        ret['length']=getstrlength(var)\n    if isarray(var):\n        ret=dictappend(ret,getarrdims(a,var))\n        dim=copy.copy(var['dimension'])\n    if c2capi_map.has_key(ret['ctype']): ret['atype']=c2capi_map[ret['ctype']]\n    # Debug info\n    if debugcapi(var):\n        il=[isintent_in,'input',isintent_out,'output',\n            isintent_inout,'inoutput',isrequired,'required',\n            isoptional,'optional',isintent_hide,'hidden',\n            iscomplex,'complex scalar',\n            l_and(isscalar,l_not(iscomplex)),'scalar',\n            isstring,'string',isarray,'array',\n            iscomplexarray,'complex array',isstringarray,'string array',\n            iscomplexfunction,'complex function',\n            l_and(isfunction,l_not(iscomplexfunction)),'function',\n            isexternal,'callback',\n            isintent_callback,'callback',\n            isintent_aux,'auxiliary',\n            #ismutable,'mutable',l_not(ismutable),'immutable',\n            ]\n        rl=[]\n        for i in range(0,len(il),2):\n            if il[i](var): rl.append(il[i+1])\n        if isstring(var):\n            rl.append('slen(%s)=%s'%(a,ret['length']))\n        if isarray(var):\n#             if not isintent_c(var):\n#                 var['dimension'].reverse()\n            ddim=string.join(map(lambda x,y:'%s|%s'%(x,y),var['dimension'],dim),',')\n            rl.append('dims(%s)'%ddim)\n#             if not isintent_c(var):\n#                 var['dimension'].reverse()\n        if isexternal(var):\n            ret['vardebuginfo']='debug-capi:%s=>%s:%s'%(a,ret['cbname'],string.join(rl,','))\n        else:\n            ret['vardebuginfo']='debug-capi:%s %s=%s:%s'%(ret['ctype'],a,ret['showinit'],string.join(rl,','))\n        if isscalar(var):\n            if cformat_map.has_key(ret['ctype']):\n                ret['vardebugshowvalue']='debug-capi:%s=%s'%(a,cformat_map[ret['ctype']])\n        if isstring(var):\n            ret['vardebugshowvalue']='debug-capi:slen(%s)=%%d %s=\\\\\"%%s\\\\\"'%(a,a)\n        if isexternal(var):\n            ret['vardebugshowvalue']='debug-capi:%s=%%p'%(a)\n    if cformat_map.has_key(ret['ctype']):\n        ret['varshowvalue']='#name#:%s=%s'%(a,cformat_map[ret['ctype']])\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isstring(var):\n        ret['varshowvalue']='#name#:slen(%s)=%%d %s=\\\\\"%%s\\\\\"'%(a,a)\n    ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,var)\n    if hasnote(var):\n        ret['note']=var['note']\n    return ret\n\ndef routsign2map(rout):\n    \"\"\"\n    name,NAME,begintitle,endtitle\n    rname,ctype,rformat\n    routdebugshowvalue\n    \"\"\"\n    global lcb_map\n    name = rout['name']\n    fname = getfortranname(rout)\n    ret={'name':name,\n         'texname':string.replace(name,'_','\\\\_'),\n         'name_lower':string.lower(name),\n         'NAME':string.upper(name),\n         'begintitle':gentitle(name),\n         'endtitle':gentitle('end of %s'%name),\n         'fortranname':fname,\n         'FORTRANNAME':string.upper(fname),\n         'callstatement':getcallstatement(rout) or '',\n         'usercode':getusercode(rout) or '',\n         'usercode1':getusercode1(rout) or '',\n         }\n    if '_' in fname:\n        ret['F_FUNC'] = 'F_FUNC_US'\n    else:\n        ret['F_FUNC'] = 'F_FUNC'\n    if '_' in name:\n        ret['F_WRAPPEDFUNC'] = 'F_WRAPPEDFUNC_US'\n    else:\n        ret['F_WRAPPEDFUNC'] = 'F_WRAPPEDFUNC'\n    lcb_map={}\n    if rout.has_key('use'):\n        for u in rout['use'].keys():\n            if cb_rules.cb_map.has_key(u):\n                for un in cb_rules.cb_map[u]:\n                    ln=un[0]\n                    if rout['use'][u].has_key('map'):\n                        for k in rout['use'][u]['map'].keys():\n                            if rout['use'][u]['map'][k]==un[0]: ln=k;break\n                    lcb_map[ln]=un[1]\n            #else:\n            #    errmess('routsign2map: cb_map does not contain module \"%s\" used in \"use\" statement.\\n'%(u))\n    elif rout.has_key('externals') and rout['externals']:\n        errmess('routsign2map: Confused: function %s has externals %s but no \"use\" statement.\\n'%(ret['name'],`rout['externals']`))\n    ret['callprotoargument'] = getcallprotoargument(rout,lcb_map) or ''\n    if isfunction(rout):\n        if rout.has_key('result'): a=rout['result']\n        else: a=rout['name']\n        ret['rname']=a\n        ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,rout)\n        ret['ctype']=getctype(rout['vars'][a])\n        if hasresultnote(rout):\n            ret['resultnote']=rout['vars'][a]['note']\n            rout['vars'][a]['note']=['See elsewhere.']\n        if c2buildvalue_map.has_key(ret['ctype']):\n            ret['rformat']=c2buildvalue_map[ret['ctype']]\n        else: \n            ret['rformat']='O'\n            errmess('routsign2map: no c2buildvalue key for type %s\\n'%(`ret['ctype']`))\n        if debugcapi(rout):\n            if cformat_map.has_key(ret['ctype']):\n                ret['routdebugshowvalue']='debug-capi:%s=%s'%(a,cformat_map[ret['ctype']])\n            if isstringfunction(rout):\n                ret['routdebugshowvalue']='debug-capi:slen(%s)=%%d %s=\\\\\"%%s\\\\\"'%(a,a)\n        if isstringfunction(rout):\n            ret['rlength']=getstrlength(rout['vars'][a])\n            if ret['rlength']=='-1':\n                errmess('routsign2map: expected explicit specification of the length of the string returned by the fortran function %s; taking 10.\\n'%(`rout['name']`))\n                ret['rlength']='10'\n    if hasnote(rout):\n        ret['note']=rout['note']\n        rout['note']=['See elsewhere.']\n    return ret\n\ndef modsign2map(m):\n    \"\"\"\n    modulename\n    \"\"\"\n    if ismodule(m):\n        ret={'f90modulename':m['name'],\n             'F90MODULENAME':string.upper(m['name']),\n             'texf90modulename':string.replace(m['name'],'_','\\\\_')}\n    else:\n        ret={'modulename':m['name'],\n             'MODULENAME':string.upper(m['name']),\n             'texmodulename':string.replace(m['name'],'_','\\\\_')}\n    ret['restdoc'] = getrestdoc(m) or []\n    if hasnote(m):\n        ret['note']=m['note']\n        #m['note']=['See elsewhere.']\n    ret['usercode'] = getusercode(m) or ''\n    ret['usercode1'] = getusercode1(m) or ''\n    if m['body']:\n        ret['interface_usercode'] = getusercode(m['body'][0]) or ''\n    else:\n        ret['interface_usercode'] = ''\n    ret['pymethoddef'] = getpymethoddef(m) or ''\n    return ret\n\ndef cb_sign2map(a,var):\n    ret={'varname':a}\n    ret['ctype']=getctype(var)\n    if c2capi_map.has_key(ret['ctype']):\n        ret['atype']=c2capi_map[ret['ctype']]\n    if cformat_map.has_key(ret['ctype']):\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isarray(var):\n        ret=dictappend(ret,getarrdims(a,var))\n    ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,var)\n    if hasnote(var):\n        ret['note']=var['note']\n        var['note']=['See elsewhere.']\n    return ret\n\ndef cb_routsign2map(rout,um):\n    \"\"\"\n    name,begintitle,endtitle,argname\n    ctype,rctype,maxnofargs,nofoptargs,returncptr\n    \"\"\"\n    ret={'name':'cb_%s_in_%s'%(rout['name'],um),\n         'returncptr':''}\n    if isintent_callback(rout):\n        if '_' in rout['name']:\n            F_FUNC='F_FUNC_US'\n        else:\n            F_FUNC='F_FUNC'\n        ret['callbackname'] = '%s(%s,%s)' \\\n                              % (F_FUNC,\n                                 rout['name'].lower(),\n                                 rout['name'].upper(),\n                                 )\n        ret['static'] = 'extern'\n    else:\n        ret['callbackname'] = ret['name']\n        ret['static'] = 'static'\n    ret['argname']=rout['name']\n    ret['begintitle']=gentitle(ret['name'])\n    ret['endtitle']=gentitle('end of %s'%ret['name'])\n    ret['ctype']=getctype(rout)\n    ret['rctype']='void'\n    if ret['ctype']=='string': ret['rctype']='void'\n    else:\n        ret['rctype']=ret['ctype']\n    if ret['rctype']!='void':\n        if iscomplexfunction(rout):\n            ret['returncptr'] = \"\"\"\n#ifdef F2PY_CB_RETURNCOMPLEX\nreturn_value=\n#endif\n\"\"\"\n        else:\n            ret['returncptr'] = 'return_value='\n    if cformat_map.has_key(ret['ctype']):\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isstringfunction(rout):\n        ret['strlength']=getstrlength(rout)\n    if isfunction(rout):\n        if rout.has_key('result'): a=rout['result']\n        else: a=rout['name']\n        if hasnote(rout['vars'][a]):\n            ret['note']=rout['vars'][a]['note']\n            rout['vars'][a]['note']=['See elsewhere.']\n        ret['rname']=a\n        ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,rout)\n        if iscomplexfunction(rout):\n            ret['rctype']=\"\"\"\n#ifdef F2PY_CB_RETURNCOMPLEX\n#ctype#            \n#else\nvoid\n#endif\n\"\"\"\n    else:\n        if hasnote(rout):\n            ret['note']=rout['note']\n            rout['note']=['See elsewhere.']\n    nofargs=0\n    nofoptargs=0\n    if rout.has_key('args') and rout.has_key('vars'):\n        for a in rout['args']:\n            var=rout['vars'][a]\n            if l_or(isintent_in,isintent_inout)(var):\n                nofargs=nofargs+1\n                if isoptional(var):\n                    nofoptargs=nofoptargs+1\n    ret['maxnofargs']=`nofargs`\n    ret['nofoptargs']=`nofoptargs`\n    if hasnote(rout) and isfunction(rout) and rout.has_key('result'):\n        ret['routnote']=rout['note']\n        rout['note']=['See elsewhere.']\n    return ret\n\ndef common_sign2map(a,var): # obsolute\n    ret={'varname':a}\n    ret['ctype']=getctype(var)\n    if isstringarray(var): ret['ctype']='char'\n    if c2capi_map.has_key(ret['ctype']):\n        ret['atype']=c2capi_map[ret['ctype']]\n    if cformat_map.has_key(ret['ctype']):\n        ret['showvalueformat']='%s'%(cformat_map[ret['ctype']])\n    if isarray(var):\n        ret=dictappend(ret,getarrdims(a,var))\n    elif isstring(var):\n        ret['size']=getstrlength(var)\n        ret['rank']='1'\n    ret['pydocsign'],ret['pydocsignout']=getpydocsign(a,var)\n    if hasnote(var):\n        ret['note']=var['note']\n        var['note']=['See elsewhere.']\n    ret['arrdocstr']=getarrdocsign(a,var) # for strings this returns 0-rank but actually is 1-rank\n    return ret\n\n\n",
                "methods": [
                    {
                        "name": "getctype",
                        "long_name": "getctype( var )",
                        "filename": "capi_maps.py",
                        "nloc": 36,
                        "complexity": 16,
                        "token_count": 292,
                        "parameters": [
                            "var"
                        ],
                        "start_line": 196,
                        "end_line": 235,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getstrlength",
                        "long_name": "getstrlength( var )",
                        "filename": "capi_maps.py",
                        "nloc": 18,
                        "complexity": 11,
                        "token_count": 167,
                        "parameters": [
                            "var"
                        ],
                        "start_line": 236,
                        "end_line": 254,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getarrdims",
                        "long_name": "getarrdims( a , var , verbose = 0 )",
                        "filename": "capi_maps.py",
                        "nloc": 45,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "a",
                            "var",
                            "verbose"
                        ],
                        "start_line": 255,
                        "end_line": 303,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getpydocsign",
                        "long_name": "getpydocsign( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 59,
                        "complexity": 21,
                        "token_count": 485,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 304,
                        "end_line": 363,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getarrdocsign",
                        "long_name": "getarrdocsign( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 108,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 364,
                        "end_line": 377,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getinit",
                        "long_name": "getinit( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 24,
                        "complexity": 12,
                        "token_count": 241,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 379,
                        "end_line": 403,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "sign2map",
                        "long_name": "sign2map( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 83,
                        "complexity": 30,
                        "token_count": 829,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 405,
                        "end_line": 501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 97,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "routsign2map",
                        "long_name": "routsign2map( rout )",
                        "filename": "capi_maps.py",
                        "nloc": 65,
                        "complexity": 26,
                        "token_count": 583,
                        "parameters": [
                            "rout"
                        ],
                        "start_line": 503,
                        "end_line": 574,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 72,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "modsign2map",
                        "long_name": "modsign2map( m )",
                        "filename": "capi_maps.py",
                        "nloc": 20,
                        "complexity": 9,
                        "token_count": 183,
                        "parameters": [
                            "m"
                        ],
                        "start_line": 576,
                        "end_line": 599,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cb_sign2map",
                        "long_name": "cb_sign2map( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 601,
                        "end_line": 614,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cb_routsign2map",
                        "long_name": "cb_routsign2map( rout , um )",
                        "filename": "capi_maps.py",
                        "nloc": 73,
                        "complexity": 21,
                        "token_count": 494,
                        "parameters": [
                            "rout",
                            "um"
                        ],
                        "start_line": 616,
                        "end_line": 692,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "common_sign2map",
                        "long_name": "common_sign2map( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 19,
                        "complexity": 7,
                        "token_count": 177,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 694,
                        "end_line": 712,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "getctype",
                        "long_name": "getctype( var )",
                        "filename": "capi_maps.py",
                        "nloc": 36,
                        "complexity": 16,
                        "token_count": 292,
                        "parameters": [
                            "var"
                        ],
                        "start_line": 153,
                        "end_line": 192,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getstrlength",
                        "long_name": "getstrlength( var )",
                        "filename": "capi_maps.py",
                        "nloc": 18,
                        "complexity": 11,
                        "token_count": 167,
                        "parameters": [
                            "var"
                        ],
                        "start_line": 193,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getarrdims",
                        "long_name": "getarrdims( a , var , verbose = 0 )",
                        "filename": "capi_maps.py",
                        "nloc": 45,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "a",
                            "var",
                            "verbose"
                        ],
                        "start_line": 212,
                        "end_line": 260,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getpydocsign",
                        "long_name": "getpydocsign( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 59,
                        "complexity": 21,
                        "token_count": 485,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 261,
                        "end_line": 320,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getarrdocsign",
                        "long_name": "getarrdocsign( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 108,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 321,
                        "end_line": 334,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getinit",
                        "long_name": "getinit( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 24,
                        "complexity": 12,
                        "token_count": 241,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 336,
                        "end_line": 360,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "sign2map",
                        "long_name": "sign2map( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 83,
                        "complexity": 30,
                        "token_count": 829,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 362,
                        "end_line": 458,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 97,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "routsign2map",
                        "long_name": "routsign2map( rout )",
                        "filename": "capi_maps.py",
                        "nloc": 65,
                        "complexity": 26,
                        "token_count": 583,
                        "parameters": [
                            "rout"
                        ],
                        "start_line": 460,
                        "end_line": 531,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 72,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "modsign2map",
                        "long_name": "modsign2map( m )",
                        "filename": "capi_maps.py",
                        "nloc": 20,
                        "complexity": 9,
                        "token_count": 183,
                        "parameters": [
                            "m"
                        ],
                        "start_line": 533,
                        "end_line": 556,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cb_sign2map",
                        "long_name": "cb_sign2map( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 558,
                        "end_line": 571,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cb_routsign2map",
                        "long_name": "cb_routsign2map( rout , um )",
                        "filename": "capi_maps.py",
                        "nloc": 73,
                        "complexity": 21,
                        "token_count": 494,
                        "parameters": [
                            "rout",
                            "um"
                        ],
                        "start_line": 573,
                        "end_line": 649,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "common_sign2map",
                        "long_name": "common_sign2map( a , var )",
                        "filename": "capi_maps.py",
                        "nloc": 19,
                        "complexity": 7,
                        "token_count": 177,
                        "parameters": [
                            "a",
                            "var"
                        ],
                        "start_line": 651,
                        "end_line": 669,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [],
                "nloc": 646,
                "complexity": 182,
                "token_count": 5080,
                "diff_parsed": {
                    "added": [
                        "",
                        "#These new maps aren't used anyhere yet, but should be by default",
                        "#  unless building numeric or numarray extensions.",
                        "newc2capi_map={'double':'PyArray_DOUBLE',",
                        "            'float':'PyArray_FLOAT',",
                        "            'long_double':'PyArray_LONGDOUBLE',",
                        "            'char':'PyArray_BYTE',",
                        "            'unsigned_char':'PyArray_UBYTE',",
                        "            'signed_char':'PyArray_BYTE',",
                        "            'short':'PyArray_SHORT',",
                        "            'unsigned_short':'PyArray_USHORT',",
                        "            'int':'PyArray_INT',",
                        "            'unsigned':'PyArray_UINT',",
                        "            'long':'PyArray_LONG',",
                        "            'unsigned_long':'PyArray_ULONG',",
                        "            'long_long':'PyArray_LONGLONG',",
                        "            'unsigned_long_long':'Pyarray_ULONGLONG',",
                        "            'complex_float':'PyArray_CFLOAT',",
                        "            'complex_double':'PyArray_CDOUBLE',",
                        "            'complex_long_double':'PyArray_CDOUBLE',",
                        "            'string':'PyArray_STRING'}",
                        "newc2pycode_map={'double':'d',",
                        "                 'float':'f',",
                        "                 'long_double':'g',",
                        "                 'char':'b',",
                        "                 'unsigned_char':'B',",
                        "                 'signed_char':'b',",
                        "                 'short':'h',",
                        "                 'unsigned_short':'H',",
                        "                 'int':'i',",
                        "                 'unsigned':'I',",
                        "                 'long':'l',",
                        "                 'unsigned_long':'L',",
                        "                 'long_long':'q',",
                        "                 'unsigned_long_long':'Q',",
                        "                 'complex_float':'F',",
                        "                 'complex_double':'D',",
                        "                 'complex_long_double':'G',",
                        "                 'string':'S'}",
                        "f2cmap_all={'real':{'':'float','4':'float','8':'double','12':'long_double','16':'long_double'},",
                        "            'complex':{'':'complex_float','8':'complex_float',",
                        "                       '16':'complex_double','24':'complex_long_double',",
                        "                       '32':'complex_long_double'},",
                        "            'complexkind':{'':'complex_float','4':'complex_float',",
                        "                           '8':'complex_double','12':'complex_long_double',",
                        "                           '16':'complex_long_double'},"
                    ],
                    "deleted": [
                        "f2cmap_all={'real':{'':'float','4':'float','8':'double','16':'long_double'},",
                        "            'complex':{'':'complex_float','8':'complex_float','16':'complex_double','32':'complex_long_double'},",
                        "            'complexkind':{'':'complex_float','4':'complex_float','8':'complex_double','16':'complex_long_double'},"
                    ]
                }
            },
            {
                "old_path": "scipy/f2py2e/f2py2e.py",
                "new_path": "scipy/f2py2e/f2py2e.py",
                "filename": "f2py2e.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -601,12 +601,15 @@ def run_compile():\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 name_value[0]=='NUMARRAY':\n                 using_numarray = 1\n+            elif name_value[0] == 'NUMERIC':\n+                using_numeric = 1\n         if len(name_value)==2:\n             define_macros[i] = tuple(name_value)\n         else:\n@@ -630,12 +633,7 @@ def run_compile():\n             print 'Failed to import numarray:',sys.exc_value\n             raise ImportError,'Must have numarray installed.'\n         num_info = get_info('numarray')\n-    elif using_newscipy:\n-        import scipy\n-        n = 'scipy'\n-        p = get_prefix(scipy)\n-        num_info = {}\n-    else:\n+    elif using_numeric:\n         try:\n             import Numeric\n             n = 'Numeric'\n@@ -643,7 +641,14 @@ def run_compile():\n         except ImportError:\n             print 'Failed to import Numeric:',sys.exc_value\n             raise ImportError,'Must have Numeric installed.'\n-        num_info = get_info('NumPy')\n+        num_info = get_info('NumPy')        \n+    else:\n+        import scipy\n+        n = 'scipy'\n+        p = get_prefix(scipy)\n+        from scipy.distutils.misc_utils import get_scipy_include_dirs\n+        num_info = {'include_dirs': get_scipy_include_dirs()}\n+        \n     if num_info:\n         include_dirs.extend(num_info.get('include_dirs',[]))\n \n",
                "added_lines": 12,
                "deleted_lines": 7,
                "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 <pearu@cens.ioc.ee>          \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\n## import buildmakefile\n## import buildsetup\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n    from scipy.distutils import __version__ as scipy_distutils_version\nexcept ImportError:\n    try:\n        from scipy_distutils import __version__ as scipy_distutils_version\n    except ImportError:\n        scipy_distutils_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n      f2py [<options>] <fortran files> [[[only:]||[skip:]] \\\\\n                                        <fortran functions> ] \\\\\n                                       [: <fortran files> ...]\n\n2) To compile fortran files and build extension modules:\n\n      f2py -c [<options>, <build_flib options>, <extra options>] <fortran files>\n\n3) To generate signature files:\n\n      f2py -h <filename.pyf> ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (<modulename>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 <filename>    Write signatures of the fortran routines to file <filename>\n                   and exit. You can then edit <filename> and use it instead\n                   of <fortran files>. If <filename>==stdout then the\n                   signatures are printed to stdout.\n  <fortran functions>  Names of fortran routines for which Python C/API\n                   functions will be generated. Default is all that are found\n                   in <fortran files>.\n  <fortran files>  Paths to fortran/signature files that will be scanned for\n                   <fortran functions> 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 <fortran files> mode.\n\n  -m <modulename>  Name of the module; f2py generates a Python/C API\n                   file <modulename>module.c or extension module <modulename>.\n                   Default is 'untitled'.\n\n  --[no-]lower     Do [not] lower the cases in <fortran files>. By default,\n                   --lower is assumed with -h key, and --no-lower without -h key.\n\n  --build-dir <dirname>  All f2py generated files are created in <dirname>.\n                   Default is tempfile.mktemp().\n\n  --overwrite-signature  Overwrite existing signature file.\n\n  --[no-]latex-doc Create (or not) <modulename>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) <modulename>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  -include'<includefile>' Add CPP #include statement to the C/API code.\n                   <includefile> should be in the format of either\n                   `\\\"filename.ext\\\"' or `<filename.ext>'.\n                   As a result <includefile> will be included just before\n                   wrapper functions part in the C/API code.\n                   [DEPRECIATED], use usercode statement in signature file.\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 <path1>:<path2>:...   Search include files from the given\n                   directories.\n\n  --help-link [..] List system resources found by system_info.py. See also\n                   --link-<resource> 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\nscipy.distutils options (only effective with -c):\n\n  --help-compiler      List available Fortran compilers [DEPRECIATED]\n  --fcompiler=         Specify Fortran compiler type by vendor\n  --compiler=          Specify C compiler type (as defined by distutils)\n  --fcompiler-exec=    Specify the path to F77 compiler [DEPRECIATED]\n  --f90compiler-exec=  Specify the path to F90 compiler [DEPRECIATED]\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-<resource>    Link extension module with <resource> as defined\n                       by scipy.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<libname>\n  -D<define> -U<name>\n  -I/path/to/include/\n  <filename>.o <filename>.so <filename>.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=<int>, a message is\n  sent to stderr whenever F2PY interface makes a copy of an\n  array. Integer <int> sets the threshold for array sizes when\n  a message should be shown.\n\nVersion:     %s\nscipy.distutils Version: %s\nRequires:    Python 1.5.2 or higher (2.x is supported).\n             Numerical Python 13 or higher (20.x,21.x,22.x are supported)\n             scipy_distutils (can be downloaded from f2py site)\nLicense:     LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, scipy_distutils_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##     dosetup = 0\n##     doscipysetup = 0\n##     domanifest = 0\n##     domakefile = 0\n    dolatexdoc = 0\n    dorestdoc = 0\n    wrapfuncs = 1\n    buildpath = '.'\n    include_paths = []\n##     do_analyze = 1\n    signsfile,modulename=None,None\n##     format='f77'\n##     makefileopts=[]\n##     options=buildmakefile.get_f2pyflags({'buildpath':buildpath})\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=='-f77': format='f77'\n##         elif l=='-f90': format='f90'\n##         elif l=='-fix': format='fix'\n        elif l[:8]=='--debug-': debug.append(l[8:])\n        elif l=='--lower': dolc=1\n##         elif l=='--skip-analyze': do_analyze=0\n        elif l=='--build-dir': f6=1\n        elif l=='--no-lower': dolc=0\n##         elif l=='--setup': dosetup=1\n##         elif l=='--scipy-setup':\n##             doscipysetup=1\n##             dosetup=1\n##         elif l=='--no-setup': dosetup=0\n        elif l=='--quiet': verbose = 0\n        elif l=='--verbose': verbose += 1\n##         elif l=='--manifest': domanifest=1\n##         elif l=='--no-manifest': domanifest=0\n##         elif l=='--makefile': domakefile=1\n##         elif l=='--no-makefile': domakefile=0\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=='--overwrite-makefile':\n##             domakefile=1\n##             makefileopts.append('--overwrite-makefile')\n##         elif l=='--overwrite-setup':\n##             dosetup=1\n##             makefileopts.append('--overwrite-setup')\n##         elif l=='--external-modroutines': options[l]=1\n##         elif l=='--no-external-modroutines': options['--external-modroutines']=0\n        elif l=='-h': f2=1\n        elif l=='-m': f3=1\n##         elif l=='--use-libs':\n##             makefileopts.append(l)\n##         elif l=='-makefile':\n##             f4=1\n        elif l[:2]=='-v':\n            print f2py_version\n            sys.exit()\n##         elif l[:6]=='-pyinc': # obsolete\n##             print os.path.join(sys.prefix,'include','python'+sys.version[:3])\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##             if f4:\n##                 makefileopts.append(l)\n##             else:\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 f4:\n##             makefileopts.append(l)\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        #errmess('Expected files and modulename but failed to got one of them\\n')\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##     if format in ['f77','f90','fix']: options['format']=format\n##     else:\n##         errmess('Illegal format \"%s\". Exiting.\\n'%(format))\n##         sys.exit()\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['do_analyze'] = do_analyze\n##     options['dosetup'] = dosetup\n##     options['doscipysetup'] = doscipysetup\n##     options['domanifest'] = domanifest\n##     options['domakefile'] = domakefile\n    options['dolatexdoc'] = dolatexdoc\n    options['dorestdoc'] = dorestdoc\n    options['wrapfuncs'] = wrapfuncs\n##     if not '--use-libs' in makefileopts:\n##         makefileopts=makefileopts+files\n##     options['makefileopts']=makefileopts\n##     options['setupopts']=makefileopts\n    options['buildpath']=buildpath\n    options['include_paths']=include_paths\n##     if f5:\n##         buildmakefile.showcompilers(options)\n##         sys.exit()\n    return files,options\n\ndef callcrackfortran(files,options):\n    rules.options=options\n    funcs=[]\n##     if options['format']=='f77':\n##         crackfortran.strictf77=1\n##         crackfortran.sourcecodeform='fix'\n##     elif options['format']=='f90':\n##         crackfortran.strictf77=0\n##         crackfortran.sourcecodeform='free'\n##     elif options['format']=='fix':\n##         crackfortran.strictf77=0\n##         crackfortran.sourcecodeform='fix'\n##     else:\n##         errmess('callcrackfortran: Unknown format. Exiting.\\n');sys.exit()\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##     if options.has_key('do_analyze'):\n##         crackfortran.do_analyze=options['do_analyze']\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##             else:\n##                 if options['dosetup']:\n##                     options['setupopts'].append('-I'+os.path.dirname(fobjhsrc))\n##                     options['setupopts'].append(fobjcsrc)\n##                     buildsetup.build(postlist[i],options)\n##                 if options['domakefile']:\n##                     buildmakefile.build(postlist[i],options)\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        #outmess('\\tOr run GNU make to build shared module: gmake -f Makefile-<modulename>\\n')\n        #outmess('\\tOr run: python setup_<modulename>.py build\\n')\n        return\n    for i in range(len(postlist)):\n        if postlist[i]['block']!='python module':\n            #errmess('All blocks must be module blocks but got %s. Exiting.\\n'%(`postlist[i]['block']`))\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    #if not quiet:\n    #outmess('Run GNU make to build shared modules: gmake -f Makefile-<modulename> [test]\\n')\n    #outmess('Or run: python setup_<modulename>.py build\\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 scipy_distutils_version[:5]>='0.2.2':\n        del_list = []\n        for s in flib_flags:\n            v = '--help-compiler'\n            if s==v:\n                nv = '--help-fcompiler'\n                print v,'is depreciated. Use',nv,'instead.'\n                fc_flags.append(nv)\n                del_list.append(s)\n                continue\n            v = '--fcompiler='\n            if s[:len(v)]==v:\n                if scipy_distutils_version[:5]>='0.4.0':\n                    from scipy.distutils import fcompiler\n                else:\n                    from scipy_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            v = '--fcompiler-exec='\n            if s[:len(v)]==v:\n                fc_flags.append('--f77exec='+s[len(v):])\n                print v+' is depreciated. Use \"%s\" instead.' % (fc_flags[-1])\n                del_list.append(s)\n                continue\n            v = '--f90compiler-exec='\n            if s[:len(v)]==v:\n                fc_flags.append('--f90exec='+s[len(v):])\n                print v+' is depreciated. Use \"%s\" instead.' % (fc_flags[-1])\n                del_list.append(s)\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    elif scipy_distutils_version[:5]>='0.2.2':\n        if scipy_distutils_version[:5]>='0.4.0':\n            from scipy.distutils.command.build_src import get_f2py_modulename\n        else:\n            from scipy_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 name_value[0]=='NUMARRAY':\n                using_numarray = 1\n            elif name_value[0] == 'NUMERIC':\n                using_numeric = 1\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    if scipy_distutils_version[:5]>='0.4.0':\n        from scipy.distutils.system_info import get_info\n        using_newscipy=1\n    else:\n        from scipy_distutils.system_info import get_info\n        using_newscipy=0\n    num_include_dir = None\n    if using_numarray:\n        try:\n            import numarray\n            n = 'numarray'\n            p = get_prefix(numarray)\n            import numarray.numinclude as numinclude\n            include_dirs.append(numinclude.include_dir)\n        except ImportError:\n            print 'Failed to import numarray:',sys.exc_value\n            raise ImportError,'Must have numarray installed.'\n        num_info = get_info('numarray')\n    elif using_numeric:\n        try:\n            import Numeric\n            n = 'Numeric'\n            p = get_prefix(Numeric)\n        except ImportError:\n            print 'Failed to import Numeric:',sys.exc_value\n            raise ImportError,'Must have Numeric installed.'\n        num_info = get_info('NumPy')        \n    else:\n        import scipy\n        n = 'scipy'\n        p = get_prefix(scipy)\n        from scipy.distutils.misc_utils import get_scipy_include_dirs\n        num_info = {'include_dirs': get_scipy_include_dirs()}\n        \n    if num_info:\n        include_dirs.extend(num_info.get('include_dirs',[]))\n\n    if scipy_distutils_version[:5]>='0.4.0':\n        from scipy.distutils.core import setup,Extension\n    else:\n        from scipy_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        if scipy_distutils_version[:5]>='0.4.0':\n            from scipy.distutils.misc_util import dict_append\n        else:\n            from scipy_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        if scipy_distutils_version[:5]>='0.2.2':\n            sys.argv.extend(['build_ext']+flib_flags)\n        else:\n            sys.argv.extend(['build_flib']+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        if scipy_distutils_version[:5]>='0.4.0':\n            from scipy.distutils.system_info import show_all\n        else:\n            from scipy_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 <pearu@cens.ioc.ee>          \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\n## import buildmakefile\n## import buildsetup\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n    from scipy.distutils import __version__ as scipy_distutils_version\nexcept ImportError:\n    try:\n        from scipy_distutils import __version__ as scipy_distutils_version\n    except ImportError:\n        scipy_distutils_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n      f2py [<options>] <fortran files> [[[only:]||[skip:]] \\\\\n                                        <fortran functions> ] \\\\\n                                       [: <fortran files> ...]\n\n2) To compile fortran files and build extension modules:\n\n      f2py -c [<options>, <build_flib options>, <extra options>] <fortran files>\n\n3) To generate signature files:\n\n      f2py -h <filename.pyf> ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (<modulename>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 <filename>    Write signatures of the fortran routines to file <filename>\n                   and exit. You can then edit <filename> and use it instead\n                   of <fortran files>. If <filename>==stdout then the\n                   signatures are printed to stdout.\n  <fortran functions>  Names of fortran routines for which Python C/API\n                   functions will be generated. Default is all that are found\n                   in <fortran files>.\n  <fortran files>  Paths to fortran/signature files that will be scanned for\n                   <fortran functions> 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 <fortran files> mode.\n\n  -m <modulename>  Name of the module; f2py generates a Python/C API\n                   file <modulename>module.c or extension module <modulename>.\n                   Default is 'untitled'.\n\n  --[no-]lower     Do [not] lower the cases in <fortran files>. By default,\n                   --lower is assumed with -h key, and --no-lower without -h key.\n\n  --build-dir <dirname>  All f2py generated files are created in <dirname>.\n                   Default is tempfile.mktemp().\n\n  --overwrite-signature  Overwrite existing signature file.\n\n  --[no-]latex-doc Create (or not) <modulename>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) <modulename>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  -include'<includefile>' Add CPP #include statement to the C/API code.\n                   <includefile> should be in the format of either\n                   `\\\"filename.ext\\\"' or `<filename.ext>'.\n                   As a result <includefile> will be included just before\n                   wrapper functions part in the C/API code.\n                   [DEPRECIATED], use usercode statement in signature file.\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 <path1>:<path2>:...   Search include files from the given\n                   directories.\n\n  --help-link [..] List system resources found by system_info.py. See also\n                   --link-<resource> 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\nscipy.distutils options (only effective with -c):\n\n  --help-compiler      List available Fortran compilers [DEPRECIATED]\n  --fcompiler=         Specify Fortran compiler type by vendor\n  --compiler=          Specify C compiler type (as defined by distutils)\n  --fcompiler-exec=    Specify the path to F77 compiler [DEPRECIATED]\n  --f90compiler-exec=  Specify the path to F90 compiler [DEPRECIATED]\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-<resource>    Link extension module with <resource> as defined\n                       by scipy.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<libname>\n  -D<define> -U<name>\n  -I/path/to/include/\n  <filename>.o <filename>.so <filename>.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=<int>, a message is\n  sent to stderr whenever F2PY interface makes a copy of an\n  array. Integer <int> sets the threshold for array sizes when\n  a message should be shown.\n\nVersion:     %s\nscipy.distutils Version: %s\nRequires:    Python 1.5.2 or higher (2.x is supported).\n             Numerical Python 13 or higher (20.x,21.x,22.x are supported)\n             scipy_distutils (can be downloaded from f2py site)\nLicense:     LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, scipy_distutils_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##     dosetup = 0\n##     doscipysetup = 0\n##     domanifest = 0\n##     domakefile = 0\n    dolatexdoc = 0\n    dorestdoc = 0\n    wrapfuncs = 1\n    buildpath = '.'\n    include_paths = []\n##     do_analyze = 1\n    signsfile,modulename=None,None\n##     format='f77'\n##     makefileopts=[]\n##     options=buildmakefile.get_f2pyflags({'buildpath':buildpath})\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=='-f77': format='f77'\n##         elif l=='-f90': format='f90'\n##         elif l=='-fix': format='fix'\n        elif l[:8]=='--debug-': debug.append(l[8:])\n        elif l=='--lower': dolc=1\n##         elif l=='--skip-analyze': do_analyze=0\n        elif l=='--build-dir': f6=1\n        elif l=='--no-lower': dolc=0\n##         elif l=='--setup': dosetup=1\n##         elif l=='--scipy-setup':\n##             doscipysetup=1\n##             dosetup=1\n##         elif l=='--no-setup': dosetup=0\n        elif l=='--quiet': verbose = 0\n        elif l=='--verbose': verbose += 1\n##         elif l=='--manifest': domanifest=1\n##         elif l=='--no-manifest': domanifest=0\n##         elif l=='--makefile': domakefile=1\n##         elif l=='--no-makefile': domakefile=0\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=='--overwrite-makefile':\n##             domakefile=1\n##             makefileopts.append('--overwrite-makefile')\n##         elif l=='--overwrite-setup':\n##             dosetup=1\n##             makefileopts.append('--overwrite-setup')\n##         elif l=='--external-modroutines': options[l]=1\n##         elif l=='--no-external-modroutines': options['--external-modroutines']=0\n        elif l=='-h': f2=1\n        elif l=='-m': f3=1\n##         elif l=='--use-libs':\n##             makefileopts.append(l)\n##         elif l=='-makefile':\n##             f4=1\n        elif l[:2]=='-v':\n            print f2py_version\n            sys.exit()\n##         elif l[:6]=='-pyinc': # obsolete\n##             print os.path.join(sys.prefix,'include','python'+sys.version[:3])\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##             if f4:\n##                 makefileopts.append(l)\n##             else:\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 f4:\n##             makefileopts.append(l)\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        #errmess('Expected files and modulename but failed to got one of them\\n')\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##     if format in ['f77','f90','fix']: options['format']=format\n##     else:\n##         errmess('Illegal format \"%s\". Exiting.\\n'%(format))\n##         sys.exit()\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['do_analyze'] = do_analyze\n##     options['dosetup'] = dosetup\n##     options['doscipysetup'] = doscipysetup\n##     options['domanifest'] = domanifest\n##     options['domakefile'] = domakefile\n    options['dolatexdoc'] = dolatexdoc\n    options['dorestdoc'] = dorestdoc\n    options['wrapfuncs'] = wrapfuncs\n##     if not '--use-libs' in makefileopts:\n##         makefileopts=makefileopts+files\n##     options['makefileopts']=makefileopts\n##     options['setupopts']=makefileopts\n    options['buildpath']=buildpath\n    options['include_paths']=include_paths\n##     if f5:\n##         buildmakefile.showcompilers(options)\n##         sys.exit()\n    return files,options\n\ndef callcrackfortran(files,options):\n    rules.options=options\n    funcs=[]\n##     if options['format']=='f77':\n##         crackfortran.strictf77=1\n##         crackfortran.sourcecodeform='fix'\n##     elif options['format']=='f90':\n##         crackfortran.strictf77=0\n##         crackfortran.sourcecodeform='free'\n##     elif options['format']=='fix':\n##         crackfortran.strictf77=0\n##         crackfortran.sourcecodeform='fix'\n##     else:\n##         errmess('callcrackfortran: Unknown format. Exiting.\\n');sys.exit()\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##     if options.has_key('do_analyze'):\n##         crackfortran.do_analyze=options['do_analyze']\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##             else:\n##                 if options['dosetup']:\n##                     options['setupopts'].append('-I'+os.path.dirname(fobjhsrc))\n##                     options['setupopts'].append(fobjcsrc)\n##                     buildsetup.build(postlist[i],options)\n##                 if options['domakefile']:\n##                     buildmakefile.build(postlist[i],options)\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        #outmess('\\tOr run GNU make to build shared module: gmake -f Makefile-<modulename>\\n')\n        #outmess('\\tOr run: python setup_<modulename>.py build\\n')\n        return\n    for i in range(len(postlist)):\n        if postlist[i]['block']!='python module':\n            #errmess('All blocks must be module blocks but got %s. Exiting.\\n'%(`postlist[i]['block']`))\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    #if not quiet:\n    #outmess('Run GNU make to build shared modules: gmake -f Makefile-<modulename> [test]\\n')\n    #outmess('Or run: python setup_<modulename>.py build\\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 scipy_distutils_version[:5]>='0.2.2':\n        del_list = []\n        for s in flib_flags:\n            v = '--help-compiler'\n            if s==v:\n                nv = '--help-fcompiler'\n                print v,'is depreciated. Use',nv,'instead.'\n                fc_flags.append(nv)\n                del_list.append(s)\n                continue\n            v = '--fcompiler='\n            if s[:len(v)]==v:\n                if scipy_distutils_version[:5]>='0.4.0':\n                    from scipy.distutils import fcompiler\n                else:\n                    from scipy_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            v = '--fcompiler-exec='\n            if s[:len(v)]==v:\n                fc_flags.append('--f77exec='+s[len(v):])\n                print v+' is depreciated. Use \"%s\" instead.' % (fc_flags[-1])\n                del_list.append(s)\n                continue\n            v = '--f90compiler-exec='\n            if s[:len(v)]==v:\n                fc_flags.append('--f90exec='+s[len(v):])\n                print v+' is depreciated. Use \"%s\" instead.' % (fc_flags[-1])\n                del_list.append(s)\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    elif scipy_distutils_version[:5]>='0.2.2':\n        if scipy_distutils_version[:5]>='0.4.0':\n            from scipy.distutils.command.build_src import get_f2py_modulename\n        else:\n            from scipy_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    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 name_value[0]=='NUMARRAY':\n                using_numarray = 1\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    if scipy_distutils_version[:5]>='0.4.0':\n        from scipy.distutils.system_info import get_info\n        using_newscipy=1\n    else:\n        from scipy_distutils.system_info import get_info\n        using_newscipy=0\n    num_include_dir = None\n    if using_numarray:\n        try:\n            import numarray\n            n = 'numarray'\n            p = get_prefix(numarray)\n            import numarray.numinclude as numinclude\n            include_dirs.append(numinclude.include_dir)\n        except ImportError:\n            print 'Failed to import numarray:',sys.exc_value\n            raise ImportError,'Must have numarray installed.'\n        num_info = get_info('numarray')\n    elif using_newscipy:\n        import scipy\n        n = 'scipy'\n        p = get_prefix(scipy)\n        num_info = {}\n    else:\n        try:\n            import Numeric\n            n = 'Numeric'\n            p = get_prefix(Numeric)\n        except ImportError:\n            print 'Failed to import Numeric:',sys.exc_value\n            raise ImportError,'Must have Numeric installed.'\n        num_info = get_info('NumPy')\n    if num_info:\n        include_dirs.extend(num_info.get('include_dirs',[]))\n\n    if scipy_distutils_version[:5]>='0.4.0':\n        from scipy.distutils.core import setup,Extension\n    else:\n        from scipy_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        if scipy_distutils_version[:5]>='0.4.0':\n            from scipy.distutils.misc_util import dict_append\n        else:\n            from scipy_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        if scipy_distutils_version[:5]>='0.2.2':\n            sys.argv.extend(['build_ext']+flib_flags)\n        else:\n            sys.argv.extend(['build_flib']+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        if scipy_distutils_version[:5]>='0.4.0':\n            from scipy.distutils.system_info import show_all\n        else:\n            from scipy_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": 187,
                        "end_line": 328,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 330,
                        "end_line": 366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "buildmodules",
                        "long_name": "buildmodules( list )",
                        "filename": "f2py2e.py",
                        "nloc": 29,
                        "complexity": 12,
                        "token_count": 315,
                        "parameters": [
                            "list"
                        ],
                        "start_line": 368,
                        "end_line": 396,
                        "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": 398,
                        "end_line": 405,
                        "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": 407,
                        "end_line": 460,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "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": 462,
                        "end_line": 475,
                        "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": 477,
                        "end_line": 479,
                        "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": 200,
                        "complexity": 50,
                        "token_count": 1488,
                        "parameters": [],
                        "start_line": 481,
                        "end_line": 699,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 219,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "main",
                        "long_name": "main( )",
                        "filename": "f2py2e.py",
                        "nloc": 13,
                        "complexity": 4,
                        "token_count": 78,
                        "parameters": [],
                        "start_line": 701,
                        "end_line": 713,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 187,
                        "end_line": 328,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 330,
                        "end_line": 366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "buildmodules",
                        "long_name": "buildmodules( list )",
                        "filename": "f2py2e.py",
                        "nloc": 29,
                        "complexity": 12,
                        "token_count": 315,
                        "parameters": [
                            "list"
                        ],
                        "start_line": 368,
                        "end_line": 396,
                        "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": 398,
                        "end_line": 405,
                        "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": 407,
                        "end_line": 460,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "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": 462,
                        "end_line": 475,
                        "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": 477,
                        "end_line": 479,
                        "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": 196,
                        "complexity": 49,
                        "token_count": 1461,
                        "parameters": [],
                        "start_line": 481,
                        "end_line": 694,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 214,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "main",
                        "long_name": "main( )",
                        "filename": "f2py2e.py",
                        "nloc": 13,
                        "complexity": 4,
                        "token_count": 78,
                        "parameters": [],
                        "start_line": 696,
                        "end_line": 708,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "run_compile",
                        "long_name": "run_compile( )",
                        "filename": "f2py2e.py",
                        "nloc": 200,
                        "complexity": 50,
                        "token_count": 1488,
                        "parameters": [],
                        "start_line": 481,
                        "end_line": 699,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 219,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 581,
                "complexity": 146,
                "token_count": 3451,
                "diff_parsed": {
                    "added": [
                        "    using_numeric = 0",
                        "            elif name_value[0] == 'NUMERIC':",
                        "                using_numeric = 1",
                        "    elif using_numeric:",
                        "        num_info = get_info('NumPy')",
                        "    else:",
                        "        import scipy",
                        "        n = 'scipy'",
                        "        p = get_prefix(scipy)",
                        "        from scipy.distutils.misc_utils import get_scipy_include_dirs",
                        "        num_info = {'include_dirs': get_scipy_include_dirs()}",
                        ""
                    ],
                    "deleted": [
                        "    elif using_newscipy:",
                        "        import scipy",
                        "        n = 'scipy'",
                        "        p = get_prefix(scipy)",
                        "        num_info = {}",
                        "    else:",
                        "        num_info = get_info('NumPy')"
                    ]
                }
            }
        ]
    },
    {
        "hash": "366fab195fb063e243b54994df6bb4b30b707f8c",
        "msg": "Fixes made necessary by change to asarray.",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-14T02:22:07+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T02:22:07+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "9f1286587474fb3fcbdf2020b1fe47400ca20b68"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 34,
        "insertions": 66,
        "lines": 100,
        "files": 7,
        "dmm_unit_size": 0.6666666666666666,
        "dmm_unit_complexity": 0.6666666666666666,
        "dmm_unit_interfacing": 0.16666666666666666,
        "modified_files": [
            {
                "old_path": "scipy/base/code_generators/generate_array_api.py",
                "new_path": "scipy/base/code_generators/generate_array_api.py",
                "filename": "generate_array_api.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -111,12 +111,26 @@\n     If max_dimensions = 0, then any number of dimensions are allowed.\n     Fix the dimension by setting min_dimension == max_dimension.\n     If the array is already contiguous (and aligned and not swapped)\n-    no copy is done, just a new reference created. \n+    no copy is done, just a new reference created.\n+    Base-class ndarray is returned.\n     \"\"\",\n      'ContiguousFromObject',\n      'PyObject *, int typenum, int, int',\n      'PyObject *'),\n \n+    (r\"\"\"Construct an array from an arbitrary Python Object.\n+    Last two integers are min_dimensions, and max_dimensions.\n+    If max_dimensions = 0, then any number of dimensions are allowed.\n+    Fix the dimension by setting min_dimension == max_dimension.\n+    If the array is already contiguous (and aligned and not swapped)\n+    no copy is done, just a new reference created.  Subclasses\n+    passed through.\n+    \"\"\",\n+     'ContiguousFromAny',\n+     'PyObject *, int typenum, int, int',\n+     'PyObject *'),\n+    \n+\n     (r\"\"\"Same as ContiguousFromObject except ensure a copy.\n     \"\"\",\n      'CopyFromObject','PyObject *, int, int, int','PyObject *'),\n",
                "added_lines": 15,
                "deleted_lines": 1,
                "source_code": "\n#  doc is comment_documentation\n\n# use list so order is preserved.\nobjectapi_list = [\n    (r\"\"\"Set internal structure with number functions that all\n    arrays will use\n    \"\"\",\n     'SetNumericOps','PyObject *dict','int'),\n\n    (r\"\"\"Get dictionary showing number functions that all\n    arrays will use\n    \"\"\",\n     'GetNumericOps','void','PyObject *'),\n\n\n    (r\"\"\"For object arrays, increment all internal references.\n    \"\"\",\n     'INCREF','PyArrayObject *','int'),\n\n    (r\"\"\"Decrement all internal references for object arrays.\n    \"\"\",     \n     'XDECREF','PyArrayObject *','int'),\n\n    (r\"\"\"Set the array print function to be a Python function.\n    \"\"\",\n     'SetStringFunction','PyObject *op, int repr','void'),\n\n    (r\"\"\"Get the PyArray_Descr structure for a type.\n    \"\"\",\n     'DescrFromType','int','PyArray_Descr *'),\n\n    (r\"\"\"Get pointer to zero of correct type for array. \n    \"\"\",\n     'Zero', 'PyArrayObject *', 'char *'),\n\n    (r\"\"\"Get pointer to one of correct type for array\n    \"\"\",\n     'One', 'PyArrayObject *', 'char *'),\n\n\n    (r\"\"\"Cast an array to a different type.\n    \"\"\",\n     'Cast','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Cast an array using typecode structure.\n    \"\"\",\n     'CastToType','PyArrayObject *, PyArray_Typecode *','PyObject *'),\n\n    (r\"\"\"Cast to an already created array.\n    \"\"\",\n     'CastTo', 'PyArrayObject *, PyArrayObject *', 'int'),\n\n    (r\"\"\"Check the type coercion rules.\n    \"\"\",\n     'CanCastSafely','int fromtype, int totype','int'),\n\n    (r\"\"\"\n    \"\"\",\n     'CanCastTo','PyArray_Typecode *, PyArray_Typecode *', 'Bool'),\n\n    (r\"\"\"Return the typecode of the array a Python object would be\n    converted to\n    \"\"\",\n     'ObjectType','PyObject *, int','int'),\n\n    (r\"\"\"\n    \"\"\",\n     'ArrayType','PyObject *, PyArray_Typecode *, PyArray_Typecode *','void'),\n\n    (r\"\"\"Return type typecode from array scalar.\n    \"\"\",\n     'TypecodeFromScalar','PyObject *, PyArray_Typecode *','void'),\n\n    (r\"\"\"Compute the size of an array (in number of items)\n    \"\"\",\n     'Size','PyObject *','intp'),\n\n    (r\"\"\"Get scalar-equivalent to 0-d array\n    \"\"\",\n     'Scalar', 'char *, int, int, int', 'PyObject *'),\n\n    (r\"\"\"Get scalar-equivalent to 0-d array\n    \"\"\",\n     'ToScalar', 'char *, PyArrayObject *', 'PyObject *'),\n\n    (r\"\"\"Get 0-dim array from scalar\n    \"\"\",\n     'FromScalar', 'PyObject *, PyArray_Typecode *', 'PyObject *'),\n\n    (r\"\"\"Register Data type\n    \"\"\",\n     'RegisterDataType', 'PyTypeObject *', 'int'),\n\n    (r\"\"\"Insert Descr Table\n    \"\"\",\n     'RegisterDescrForType', 'int, PyArray_Descr *', 'int'),\n    \n    (r\"\"\"Construct an empty array from dimensions and typenum\n    \"\"\",\n     'FromDims','int nd, int *, int typenum','PyObject *'),\n\n    (r\"\"\"Construct an array from dimensions, typenum, and a pointer\n    to the data.  Python will never free this (unless you later set\n    the OWN_DATA flag). \n    \"\"\",\n     'FromDimsAndData','int, int *, int, char *','PyObject *'),\n\n    (r\"\"\"Construct an array from an arbitrary Python Object.\n    Last two integers are min_dimensions, and max_dimensions.\n    If max_dimensions = 0, then any number of dimensions are allowed.\n    Fix the dimension by setting min_dimension == max_dimension.\n    If the array is already contiguous (and aligned and not swapped)\n    no copy is done, just a new reference created.\n    Base-class ndarray is returned.\n    \"\"\",\n     'ContiguousFromObject',\n     'PyObject *, int typenum, int, int',\n     'PyObject *'),\n\n    (r\"\"\"Construct an array from an arbitrary Python Object.\n    Last two integers are min_dimensions, and max_dimensions.\n    If max_dimensions = 0, then any number of dimensions are allowed.\n    Fix the dimension by setting min_dimension == max_dimension.\n    If the array is already contiguous (and aligned and not swapped)\n    no copy is done, just a new reference created.  Subclasses\n    passed through.\n    \"\"\",\n     'ContiguousFromAny',\n     'PyObject *, int typenum, int, int',\n     'PyObject *'),\n    \n\n    (r\"\"\"Same as ContiguousFromObject except ensure a copy.\n    \"\"\",\n     'CopyFromObject','PyObject *, int, int, int','PyObject *'),\n\n    (r\"\"\"Can return a discontiguous array (but aligned and byteswapped)\n    \"\"\",\n     'FromObject','PyObject *, int, int, int','PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'FromAny', 'PyObject *, PyArray_Typecode *, int, int, int', 'PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'EnsureArray', 'PyObject *', 'PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'FromFile', 'FILE *, PyArray_Typecode *, intp, char *','PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'FromBuffer', 'PyObject *, PyArray_Typecode *, intp, int','PyObject *'),\n\n    (r\"\"\"Return either an array or the appropriate Python object if the\n    array is 0d and matches a Python type.\n    \"\"\",\n     'Return','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Get a subset of bytes from each element of the array\n    \"\"\",\n     'GetField', 'PyArrayObject *, PyArray_Typecode *, int', 'PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'Byteswap', 'PyArrayObject *, Bool', 'PyObject *'),\n\n    (r\"\"\"Resize (reallocate data).  Only works if nothing else is\n    referencing this array and it is contiguous.\n    \"\"\",\n     'Resize','PyArrayObject *ap, PyArray_Dims *newshape','PyObject *'),\n\n    (r\"\"\"Copy an array.\n    \"\"\",\n     'Copy','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Like FromDimsAndData but uses the Descr structure instead of\n    typecode as input.\n    \"\"\",\n     'FromDimsAndDataAndDescr','int, int *, PyArray_Descr *, char *',\n     'PyObject *'),\n\n    (r\"\"\"Copy an Array into another array.\n    \"\"\",\n     'CopyInto', 'PyArrayObject *dest, PyArrayObject *src', 'int'),\n\n    (r\"\"\"To List\n    \"\"\",\n     'ToList','PyArrayObject *', 'PyObject *'),\n\n    (r\"\"\"To File\n    \"\"\",\n     'ToFile','PyArrayObject *, FILE *, char *, char *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'Dump', 'PyObject *, PyObject *, int', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'Dumps', 'PyObject *, int', 'PyObject *'),\n    \n    \n    (r\"\"\"Is the typenum valid?\n    \"\"\",\n     'ValidType','int','int'),  \n\n    (r\"\"\"Update Several Flags at once.\n    \"\"\",\n     'UpdateFlags','PyArrayObject *, int','void'),\n\n    (r\"\"\"Generic new array creation routine.\n    \"\"\",\n     'New','PyTypeObject *, int nd, intp *dims, int type, intp *strides, char *data, int itemsize, int fortran, PyObject *obj', 'PyObject *'),\n\n    (r\"\"\"Get Priority from object\n    \"\"\",\n     'GetPriority', 'PyObject *, double', 'double'),\n\n    (r\"\"\"Get Iterator.\n    \"\"\",\n     'IterNew','PyObject *', 'PyObject *'),\n\n    (r\"\"\"Map Iterator.\n    \"\"\",\n     'MapIterNew', 'PyObject *', 'PyObject *'),\n\n    (r\"\"\"Bind Map Iterator\n    \"\"\",\n     'MapIterBind', 'PyArrayMapIterObject *, PyArrayObject *', 'void'),\n\n    (r\"\"\"Bind Map Iterator\n    \"\"\",\n     'MapIterReset', 'PyArrayMapIterObject *', 'void'),\n\n    (r\"\"\"\n    \"\"\",\n     'MapIterNext', 'PyArrayMapIterObject *', 'void'),\n\n    (r\"\"\"\n    \"\"\",\n     'PyIntAsInt', 'PyObject *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'PyIntAsIntp','PyObject *', 'intp'),\n\n    (r\"\"\"\n    \"\"\",\n     'Broadcast', 'PyArrayMultiIterObject *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'FillObjectArray', 'PyArrayObject *, PyObject *','void'),\n\n    (r\"\"\"\n    \"\"\",\n     'CheckStrides', 'int, int, intp, intp *, intp *', 'Bool')\n\n    ]\n\nmultiapi_list = [\n    (r\"\"\"Return Transpose.\n    \"\"\",\n     'Transpose','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Take\n    \"\"\",\n     'Take','PyArrayObject *, PyObject *, int axis','PyObject *'),\n\n    (r\"\"\"Put values into an array\n    \"\"\",\n     'Put','PyArrayObject *arr, PyObject *items, PyObject *values','PyObject *'),\n\n    (r\"\"\"Put values into an array according to a mask.\n    \"\"\",\n     'PutMask','PyArrayObject *arr, PyObject *mask, PyObject *values','PyObject *'),\n\n    (r\"\"\"Repeat the array.\n    \"\"\",\n     'Repeat','PyArrayObject *, PyObject *, int','PyObject *'),\n\n    (r\"\"\"Numeric.choose()\n    \"\"\",\n     'Choose','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Sort an array\n    \"\"\",\n     'Sort','PyArrayObject *, int', 'PyObject *'),\n\n    (r\"\"\"ArgSort an array\n    \"\"\",\n     'ArgSort','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Numeric.searchsorted(a,v)\n    \"\"\",\n     'SearchSorted','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"ArgMax\n    \"\"\",\n     'ArgMax','PyArrayObject *, int','PyObject *'),\n    \n    (r\"\"\"ArgMin\n    \"\"\",\n     'ArgMin','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Reshape an array\n    \"\"\",\n     'Reshape','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"New shape for an array\n    \"\"\",\n     'Newshape','PyArrayObject *, PyArray_Dims *','PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'Squeeze','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"View\n    \"\"\",\n     'View','PyArrayObject *, PyArray_Typecode *','PyObject *'),\n\n    (r\"\"\"SwapAxes\n    \"\"\",\n     'SwapAxes','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Max\n    \"\"\",\n     'Max','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Min\n    \"\"\",\n     'Min','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Ptp\n    \"\"\",\n     'Ptp','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Mean\n    \"\"\",\n     'Mean','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Trace\n    \"\"\",\n     'Trace','PyArrayObject *, int, int, int, int','PyObject *'),\n\n    (r\"\"\"Diagonal\n    \"\"\",\n     'Diagonal','PyArrayObject *, int, int, int','PyObject *'),\n\n    (r\"\"\"Clip\n    \"\"\",\n     'Clip','PyArrayObject *, PyObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Conjugate\n    \"\"\",\n     'Conjugate','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Nonzero\n    \"\"\",\n     'Nonzero','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Std\n    \"\"\",\n     'Std','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Sum\n    \"\"\",\n     'Sum','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"CumSum\n    \"\"\",\n     'CumSum','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Prod\n    \"\"\",\n     'Prod','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"CumProd\n    \"\"\",\n     'CumProd','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"All\n    \"\"\",\n     'All','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Any\n    \"\"\",\n     'Any','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Compress\n    \"\"\",\n     'Compress','PyArrayObject *, PyObject *, int','PyObject *'),\n\n    (r\"\"\"Flatten\n    \"\"\",\n     'Flatten','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Ravel\n    \"\"\",\n     'Ravel','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Multiply a List\n    \"\"\",\n     'MultiplyList','intp *lp, int n','intp'),\n\n    (r\"\"\"Multiply a List of ints\n    \"\"\",\n     'MultiplyIntList','int *lp, int n','int'),\n\n\n    (r\"\"\"Compare Lists\n    \"\"\",\n     'CompareLists','intp *, intp *, int n','int'),    \n\n    (r\"\"\"Simulat a C-array\n    \"\"\",\n     \"AsCArray\",'PyObject **, void *ptr, intp *, int, int','int'),\n\n    (r\"\"\"Convert to a 1D C-array\n    \"\"\",\n     'As1D','PyObject **, char **ptr, int *d1, int typecode','int'),\n\n    (r\"\"\"Convert to a 2D C-array\n    \"\"\",\n     'As2D','PyObject **, char ***ptr, int *d1, int *d2, int typecode','int'),\n\n    (r\"\"\"Free pointers created if As2D is called\n    \"\"\",\n     'Free','PyObject *, void *','int'),\n\n    (r\"\"\"Useful to pass as converter function for O& processing in\n    PyArgs_ParseTuple.\n    \"\"\",\n     'Converter','PyObject *, PyObject **','int'),\n\n    (r\"\"\"PyArray_IntpFromSequence\n    \"\"\",\n     'IntpFromSequence', 'PyObject *, intp *, int', 'int'), \n\n    (r\"\"\"Concatenate an arbitrary Python sequence into\n     an array.\n    \"\"\",\n     'Concatenate','PyObject *, int','PyObject *'),\n\n    (r\"\"\"Numeric.innerproduct(a,v)\n    \"\"\",\n     'InnerProduct','PyObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Numeric.matrixproduct(a,v)\n    \"\"\",\n     'MatrixProduct','PyObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Fast Copy and Transpose\n    \"\"\",\n     'CopyAndTranspose','PyObject *','PyObject *'),\n\n    (r\"\"\"Numeric.correlate(a1,a2,mode)\n    \"\"\",\n     'Correlate','PyObject *, PyObject *, int mode','PyObject *'),\n    \n    (r\"\"\"Typestr converter\n    \"\"\",\n     'TypestrConvert', 'int, int', 'int'),\n\n    (r\"\"\"Get typenum from an object -- a converter function\n    \"\"\",\n     'TypecodeConverter','PyObject *, PyArray_Typecode *', 'int'),\n\n    (r\"\"\"Get intp chunk from sequence\n    \"\"\",\n     'IntpConverter', 'PyObject *, PyArray_Dims *', 'int'),\n\n    (r\"\"\"Get buffer chunk from object\n    \"\"\",\n     'BufferConverter', 'PyObject *, PyArray_Chunk *', 'int'),\n\n    (r\"\"\"Get axis from an object (possibly None) -- a converter function,\n    \"\"\",\n     'AxisConverter','PyObject *, int *', 'int'),\n\n    (r\"\"\"Convert an object to true / false\n    \"\"\",\n     'BoolConverter','PyObject *, Bool *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'EquivalentTypes', 'PyArray_Typecode *, PyArray_Typecode *', 'Bool'),\n\n    (r\"\"\"\n    \"\"\",\n     'EquivArrTypes', 'PyArrayObject *, PyArrayObject *', 'Bool'),\n\n    (r\"\"\"Zeros\n    \"\"\",\n     'Zeros', 'int, intp *, PyArray_Typecode *', 'PyObject *'),\n\n    (r\"\"\"Empty\n    \"\"\",\n     'Empty', 'int, intp *, PyArray_Typecode *', 'PyObject *'),\n\n\n    (r\"\"\"Where\n    \"\"\",\n      'Where', 'PyObject *, PyObject *, PyObject *', 'PyObject *'),\n\n    (r\"\"\"Arange\n    \"\"\",\n     'Arange', 'double, double, double, int', 'PyObject *')\n    \n    ]\n\n\ntypes = ['Generic','Numeric','Integer','SignedInteger','UnsignedInteger', 'Inexact',\n         'Floating', 'Complex', 'Flexible', 'Character',\n         'Bool','Byte','Short','Int', 'Long', 'LongLong', 'UByte', 'UShort',\n         'UInt', 'ULong', 'ULongLong', 'Float', 'Double', 'LongDouble',\n         'CFloat', 'CDouble', 'CLongDouble', 'Object', 'String', 'Unicode',\n         'Void']\n\n# API fixes for __arrayobject_api.h\n\nfixed = 5\nnumtypes = len(types) + fixed\nnumobject = len(objectapi_list) + numtypes\nnummulti = len(multiapi_list) \nnumtotal = numobject + nummulti\n\n\nmodule_list = []\nextension_list = []\ninit_list = []\n\n# setup types\nfor k, atype in enumerate(types):\n    num = fixed + k\n    astr = \"        (void *) &Py%sArrType_Type,\" % types[k]\n    init_list.append(astr)\n    astr = \"static PyTypeObject Py%sArrType_Type;\" % types[k]\n    module_list.append(astr)\n    astr = \"#define Py%sArrType_Type (*(PyTypeObject *)PyArray_API[%d])\" % \\\n           (types[k], num)\n    extension_list.append(astr)\n\n\n#setup object API\nfor k, item in enumerate(objectapi_list):\n    num = numtypes + k\n    astr = \"static %s PyArray_%s \\\\\\n       (%s);\" % \\\n           (item[3],item[1],item[2])\n    module_list.append(astr)\n    astr = \"#define PyArray_%s \\\\\\n        (*(%s (*)(%s)) \\\\\\n\"\\\n           \"         PyArray_API[%d])\" % (item[1],item[3],item[2],num)\n    extension_list.append(astr)\n    astr = \"        (void *) PyArray_%s,\" % item[1]\n    init_list.append(astr)\n\n    \n##outstr = r\"\"\"\n###ifdef _ARRAYOBJECT\n\n##static PyTypeObject PyArray_Type;\n##static PyTypeObject PyArrayIter_Type;\n\n##%s\n\n\n###else\n\n###define PyArray_Type (*(PyTypeObject *)PyArray_API[0])\n###define PyArrayIter_Type (*(PyTypeObject *)PyArray_API[1])\n\n##%s\n\n###endif\n##\"\"\" % ('\\n'.join(module_list), '\\n'.join(extension_list))\n\n### Write out to header\n##fid = open('__arrayobject_api.h','w')\n##fid.write(outstr)\n##fid.close()\n\n\n##outstr = r\"\"\"\n##/* Export only these pointers */\n\n##void *arrayobject_API[] = {\n##        (void *) &PyArray_Type,\n##        (void *) &PyArrayIter_Type,\n##%s\n##};\n##\"\"\" % '\\n'.join(init_list)\n\n###Write out to c-code\n##fid = open('__arrayobject_api.c','w')\n##fid.write(outstr)\n##fid.close()\n\n\n#module_list = []\n#extension_list = []\n#init_list = []\n\n# setup multiarray module API\nfor k, item in enumerate(multiapi_list):\n    num = numobject + k\n    astr = \"static %s PyArray_%s \\\\\\n       (%s);\" % \\\n           (item[3],item[1],item[2])\n    module_list.append(astr)\n    astr = \"#define PyArray_%s \\\\\\n        (*(%s (*)(%s)) \\\\\\n\"\\\n           \"         PyArray_API[%d])\" % (item[1],item[3],item[2],num)\n    extension_list.append(astr)\n    astr = \"        (void *) PyArray_%s,\" % item[1]\n    init_list.append(astr)\n\n\noutstr = r\"\"\"\n#ifdef _MULTIARRAYMODULE\n\nstatic PyTypeObject PyBigArray_Type;\nstatic PyTypeObject PyArray_Type;\nstatic PyTypeObject PyArrayIter_Type;\nstatic PyTypeObject PyArrayMapIter_Type;\nstatic int PyArray_NUMUSERTYPES=0;\n\n%s\n\n#else\n\nstatic void **PyArray_API=NULL;\n\n#define PyBigArray_Type (*(PyTypeObject *)PyArray_API[0])\n#define PyArray_Type (*(PyTypeObject *)PyArray_API[1])\n#define PyArrayIter_Type (*(PyTypeObject *)PyArray_API[2])\n#define PyArrayMapIter_Type (*(PyTypeObject *)PyArray_API[3])\n#define PyArray_NUMUSERTYPES (*(int *)PyArray_API[4])\n\n%s\n\nstatic int\nimport_array(void) \n{ \n  PyObject *numpy = PyImport_ImportModule(\"scipy.base.multiarray\");\n  PyObject *c_api = NULL;\n  if (numpy == NULL) return -1;\n  c_api = PyObject_GetAttrString(numpy, \"_ARRAY_API\");\n  if (c_api == NULL) {Py_DECREF(numpy); return -1;}\n  if (PyCObject_Check(c_api)) { \n      PyArray_API = (void **)PyCObject_AsVoidPtr(c_api); \n  }\n  Py_DECREF(c_api);\n  Py_DECREF(numpy);\n  if (PyArray_API == NULL) return -1;\n  return 0;\n}\n\n#endif\n\n\"\"\" % ('\\n'.join(module_list), \n       '\\n'.join(extension_list))\n\n# Write to header\nfid = open('__multiarray_api.h','w')\nfid.write(outstr)\nfid.close()\n\n\noutstr = r\"\"\"\n/* These pointers will be stored in the C-object for use in other\n    extension modules\n*/\n\nvoid *PyArray_API[] = {\n        (void *) &PyBigArray_Type,\n        (void *) &PyArray_Type,\n        (void *) &PyArrayIter_Type,\n        (void *) &PyArrayMapIter_Type,\n        (int *) &PyArray_NUMUSERTYPES,\n%s\n};\n\"\"\" % '\\n'.join(init_list)\n\n# Write to c-code\nfid = open('__multiarray_api.c','w')\nfid.write(outstr)\nfid.close()\n\n\n\n\n",
                "source_code_before": "\n#  doc is comment_documentation\n\n# use list so order is preserved.\nobjectapi_list = [\n    (r\"\"\"Set internal structure with number functions that all\n    arrays will use\n    \"\"\",\n     'SetNumericOps','PyObject *dict','int'),\n\n    (r\"\"\"Get dictionary showing number functions that all\n    arrays will use\n    \"\"\",\n     'GetNumericOps','void','PyObject *'),\n\n\n    (r\"\"\"For object arrays, increment all internal references.\n    \"\"\",\n     'INCREF','PyArrayObject *','int'),\n\n    (r\"\"\"Decrement all internal references for object arrays.\n    \"\"\",     \n     'XDECREF','PyArrayObject *','int'),\n\n    (r\"\"\"Set the array print function to be a Python function.\n    \"\"\",\n     'SetStringFunction','PyObject *op, int repr','void'),\n\n    (r\"\"\"Get the PyArray_Descr structure for a type.\n    \"\"\",\n     'DescrFromType','int','PyArray_Descr *'),\n\n    (r\"\"\"Get pointer to zero of correct type for array. \n    \"\"\",\n     'Zero', 'PyArrayObject *', 'char *'),\n\n    (r\"\"\"Get pointer to one of correct type for array\n    \"\"\",\n     'One', 'PyArrayObject *', 'char *'),\n\n\n    (r\"\"\"Cast an array to a different type.\n    \"\"\",\n     'Cast','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Cast an array using typecode structure.\n    \"\"\",\n     'CastToType','PyArrayObject *, PyArray_Typecode *','PyObject *'),\n\n    (r\"\"\"Cast to an already created array.\n    \"\"\",\n     'CastTo', 'PyArrayObject *, PyArrayObject *', 'int'),\n\n    (r\"\"\"Check the type coercion rules.\n    \"\"\",\n     'CanCastSafely','int fromtype, int totype','int'),\n\n    (r\"\"\"\n    \"\"\",\n     'CanCastTo','PyArray_Typecode *, PyArray_Typecode *', 'Bool'),\n\n    (r\"\"\"Return the typecode of the array a Python object would be\n    converted to\n    \"\"\",\n     'ObjectType','PyObject *, int','int'),\n\n    (r\"\"\"\n    \"\"\",\n     'ArrayType','PyObject *, PyArray_Typecode *, PyArray_Typecode *','void'),\n\n    (r\"\"\"Return type typecode from array scalar.\n    \"\"\",\n     'TypecodeFromScalar','PyObject *, PyArray_Typecode *','void'),\n\n    (r\"\"\"Compute the size of an array (in number of items)\n    \"\"\",\n     'Size','PyObject *','intp'),\n\n    (r\"\"\"Get scalar-equivalent to 0-d array\n    \"\"\",\n     'Scalar', 'char *, int, int, int', 'PyObject *'),\n\n    (r\"\"\"Get scalar-equivalent to 0-d array\n    \"\"\",\n     'ToScalar', 'char *, PyArrayObject *', 'PyObject *'),\n\n    (r\"\"\"Get 0-dim array from scalar\n    \"\"\",\n     'FromScalar', 'PyObject *, PyArray_Typecode *', 'PyObject *'),\n\n    (r\"\"\"Register Data type\n    \"\"\",\n     'RegisterDataType', 'PyTypeObject *', 'int'),\n\n    (r\"\"\"Insert Descr Table\n    \"\"\",\n     'RegisterDescrForType', 'int, PyArray_Descr *', 'int'),\n    \n    (r\"\"\"Construct an empty array from dimensions and typenum\n    \"\"\",\n     'FromDims','int nd, int *, int typenum','PyObject *'),\n\n    (r\"\"\"Construct an array from dimensions, typenum, and a pointer\n    to the data.  Python will never free this (unless you later set\n    the OWN_DATA flag). \n    \"\"\",\n     'FromDimsAndData','int, int *, int, char *','PyObject *'),\n\n    (r\"\"\"Construct an array from an arbitrary Python Object.\n    Last two integers are min_dimensions, and max_dimensions.\n    If max_dimensions = 0, then any number of dimensions are allowed.\n    Fix the dimension by setting min_dimension == max_dimension.\n    If the array is already contiguous (and aligned and not swapped)\n    no copy is done, just a new reference created. \n    \"\"\",\n     'ContiguousFromObject',\n     'PyObject *, int typenum, int, int',\n     'PyObject *'),\n\n    (r\"\"\"Same as ContiguousFromObject except ensure a copy.\n    \"\"\",\n     'CopyFromObject','PyObject *, int, int, int','PyObject *'),\n\n    (r\"\"\"Can return a discontiguous array (but aligned and byteswapped)\n    \"\"\",\n     'FromObject','PyObject *, int, int, int','PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'FromAny', 'PyObject *, PyArray_Typecode *, int, int, int', 'PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'EnsureArray', 'PyObject *', 'PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'FromFile', 'FILE *, PyArray_Typecode *, intp, char *','PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'FromBuffer', 'PyObject *, PyArray_Typecode *, intp, int','PyObject *'),\n\n    (r\"\"\"Return either an array or the appropriate Python object if the\n    array is 0d and matches a Python type.\n    \"\"\",\n     'Return','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Get a subset of bytes from each element of the array\n    \"\"\",\n     'GetField', 'PyArrayObject *, PyArray_Typecode *, int', 'PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'Byteswap', 'PyArrayObject *, Bool', 'PyObject *'),\n\n    (r\"\"\"Resize (reallocate data).  Only works if nothing else is\n    referencing this array and it is contiguous.\n    \"\"\",\n     'Resize','PyArrayObject *ap, PyArray_Dims *newshape','PyObject *'),\n\n    (r\"\"\"Copy an array.\n    \"\"\",\n     'Copy','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Like FromDimsAndData but uses the Descr structure instead of\n    typecode as input.\n    \"\"\",\n     'FromDimsAndDataAndDescr','int, int *, PyArray_Descr *, char *',\n     'PyObject *'),\n\n    (r\"\"\"Copy an Array into another array.\n    \"\"\",\n     'CopyInto', 'PyArrayObject *dest, PyArrayObject *src', 'int'),\n\n    (r\"\"\"To List\n    \"\"\",\n     'ToList','PyArrayObject *', 'PyObject *'),\n\n    (r\"\"\"To File\n    \"\"\",\n     'ToFile','PyArrayObject *, FILE *, char *, char *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'Dump', 'PyObject *, PyObject *, int', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'Dumps', 'PyObject *, int', 'PyObject *'),\n    \n    \n    (r\"\"\"Is the typenum valid?\n    \"\"\",\n     'ValidType','int','int'),  \n\n    (r\"\"\"Update Several Flags at once.\n    \"\"\",\n     'UpdateFlags','PyArrayObject *, int','void'),\n\n    (r\"\"\"Generic new array creation routine.\n    \"\"\",\n     'New','PyTypeObject *, int nd, intp *dims, int type, intp *strides, char *data, int itemsize, int fortran, PyObject *obj', 'PyObject *'),\n\n    (r\"\"\"Get Priority from object\n    \"\"\",\n     'GetPriority', 'PyObject *, double', 'double'),\n\n    (r\"\"\"Get Iterator.\n    \"\"\",\n     'IterNew','PyObject *', 'PyObject *'),\n\n    (r\"\"\"Map Iterator.\n    \"\"\",\n     'MapIterNew', 'PyObject *', 'PyObject *'),\n\n    (r\"\"\"Bind Map Iterator\n    \"\"\",\n     'MapIterBind', 'PyArrayMapIterObject *, PyArrayObject *', 'void'),\n\n    (r\"\"\"Bind Map Iterator\n    \"\"\",\n     'MapIterReset', 'PyArrayMapIterObject *', 'void'),\n\n    (r\"\"\"\n    \"\"\",\n     'MapIterNext', 'PyArrayMapIterObject *', 'void'),\n\n    (r\"\"\"\n    \"\"\",\n     'PyIntAsInt', 'PyObject *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'PyIntAsIntp','PyObject *', 'intp'),\n\n    (r\"\"\"\n    \"\"\",\n     'Broadcast', 'PyArrayMultiIterObject *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'FillObjectArray', 'PyArrayObject *, PyObject *','void'),\n\n    (r\"\"\"\n    \"\"\",\n     'CheckStrides', 'int, int, intp, intp *, intp *', 'Bool')\n\n    ]\n\nmultiapi_list = [\n    (r\"\"\"Return Transpose.\n    \"\"\",\n     'Transpose','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Take\n    \"\"\",\n     'Take','PyArrayObject *, PyObject *, int axis','PyObject *'),\n\n    (r\"\"\"Put values into an array\n    \"\"\",\n     'Put','PyArrayObject *arr, PyObject *items, PyObject *values','PyObject *'),\n\n    (r\"\"\"Put values into an array according to a mask.\n    \"\"\",\n     'PutMask','PyArrayObject *arr, PyObject *mask, PyObject *values','PyObject *'),\n\n    (r\"\"\"Repeat the array.\n    \"\"\",\n     'Repeat','PyArrayObject *, PyObject *, int','PyObject *'),\n\n    (r\"\"\"Numeric.choose()\n    \"\"\",\n     'Choose','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Sort an array\n    \"\"\",\n     'Sort','PyArrayObject *, int', 'PyObject *'),\n\n    (r\"\"\"ArgSort an array\n    \"\"\",\n     'ArgSort','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Numeric.searchsorted(a,v)\n    \"\"\",\n     'SearchSorted','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"ArgMax\n    \"\"\",\n     'ArgMax','PyArrayObject *, int','PyObject *'),\n    \n    (r\"\"\"ArgMin\n    \"\"\",\n     'ArgMin','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Reshape an array\n    \"\"\",\n     'Reshape','PyArrayObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"New shape for an array\n    \"\"\",\n     'Newshape','PyArrayObject *, PyArray_Dims *','PyObject *'),\n\n    (r\"\"\"\n    \"\"\",\n     'Squeeze','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"View\n    \"\"\",\n     'View','PyArrayObject *, PyArray_Typecode *','PyObject *'),\n\n    (r\"\"\"SwapAxes\n    \"\"\",\n     'SwapAxes','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Max\n    \"\"\",\n     'Max','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Min\n    \"\"\",\n     'Min','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Ptp\n    \"\"\",\n     'Ptp','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Mean\n    \"\"\",\n     'Mean','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Trace\n    \"\"\",\n     'Trace','PyArrayObject *, int, int, int, int','PyObject *'),\n\n    (r\"\"\"Diagonal\n    \"\"\",\n     'Diagonal','PyArrayObject *, int, int, int','PyObject *'),\n\n    (r\"\"\"Clip\n    \"\"\",\n     'Clip','PyArrayObject *, PyObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Conjugate\n    \"\"\",\n     'Conjugate','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Nonzero\n    \"\"\",\n     'Nonzero','PyArrayObject *','PyObject *'),\n\n    (r\"\"\"Std\n    \"\"\",\n     'Std','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Sum\n    \"\"\",\n     'Sum','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"CumSum\n    \"\"\",\n     'CumSum','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"Prod\n    \"\"\",\n     'Prod','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"CumProd\n    \"\"\",\n     'CumProd','PyArrayObject *, int, int','PyObject *'),\n\n    (r\"\"\"All\n    \"\"\",\n     'All','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Any\n    \"\"\",\n     'Any','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Compress\n    \"\"\",\n     'Compress','PyArrayObject *, PyObject *, int','PyObject *'),\n\n    (r\"\"\"Flatten\n    \"\"\",\n     'Flatten','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Ravel\n    \"\"\",\n     'Ravel','PyArrayObject *, int','PyObject *'),\n\n    (r\"\"\"Multiply a List\n    \"\"\",\n     'MultiplyList','intp *lp, int n','intp'),\n\n    (r\"\"\"Multiply a List of ints\n    \"\"\",\n     'MultiplyIntList','int *lp, int n','int'),\n\n\n    (r\"\"\"Compare Lists\n    \"\"\",\n     'CompareLists','intp *, intp *, int n','int'),    \n\n    (r\"\"\"Simulat a C-array\n    \"\"\",\n     \"AsCArray\",'PyObject **, void *ptr, intp *, int, int','int'),\n\n    (r\"\"\"Convert to a 1D C-array\n    \"\"\",\n     'As1D','PyObject **, char **ptr, int *d1, int typecode','int'),\n\n    (r\"\"\"Convert to a 2D C-array\n    \"\"\",\n     'As2D','PyObject **, char ***ptr, int *d1, int *d2, int typecode','int'),\n\n    (r\"\"\"Free pointers created if As2D is called\n    \"\"\",\n     'Free','PyObject *, void *','int'),\n\n    (r\"\"\"Useful to pass as converter function for O& processing in\n    PyArgs_ParseTuple.\n    \"\"\",\n     'Converter','PyObject *, PyObject **','int'),\n\n    (r\"\"\"PyArray_IntpFromSequence\n    \"\"\",\n     'IntpFromSequence', 'PyObject *, intp *, int', 'int'), \n\n    (r\"\"\"Concatenate an arbitrary Python sequence into\n     an array.\n    \"\"\",\n     'Concatenate','PyObject *, int','PyObject *'),\n\n    (r\"\"\"Numeric.innerproduct(a,v)\n    \"\"\",\n     'InnerProduct','PyObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Numeric.matrixproduct(a,v)\n    \"\"\",\n     'MatrixProduct','PyObject *, PyObject *','PyObject *'),\n\n    (r\"\"\"Fast Copy and Transpose\n    \"\"\",\n     'CopyAndTranspose','PyObject *','PyObject *'),\n\n    (r\"\"\"Numeric.correlate(a1,a2,mode)\n    \"\"\",\n     'Correlate','PyObject *, PyObject *, int mode','PyObject *'),\n    \n    (r\"\"\"Typestr converter\n    \"\"\",\n     'TypestrConvert', 'int, int', 'int'),\n\n    (r\"\"\"Get typenum from an object -- a converter function\n    \"\"\",\n     'TypecodeConverter','PyObject *, PyArray_Typecode *', 'int'),\n\n    (r\"\"\"Get intp chunk from sequence\n    \"\"\",\n     'IntpConverter', 'PyObject *, PyArray_Dims *', 'int'),\n\n    (r\"\"\"Get buffer chunk from object\n    \"\"\",\n     'BufferConverter', 'PyObject *, PyArray_Chunk *', 'int'),\n\n    (r\"\"\"Get axis from an object (possibly None) -- a converter function,\n    \"\"\",\n     'AxisConverter','PyObject *, int *', 'int'),\n\n    (r\"\"\"Convert an object to true / false\n    \"\"\",\n     'BoolConverter','PyObject *, Bool *', 'int'),\n\n    (r\"\"\"\n    \"\"\",\n     'EquivalentTypes', 'PyArray_Typecode *, PyArray_Typecode *', 'Bool'),\n\n    (r\"\"\"\n    \"\"\",\n     'EquivArrTypes', 'PyArrayObject *, PyArrayObject *', 'Bool'),\n\n    (r\"\"\"Zeros\n    \"\"\",\n     'Zeros', 'int, intp *, PyArray_Typecode *', 'PyObject *'),\n\n    (r\"\"\"Empty\n    \"\"\",\n     'Empty', 'int, intp *, PyArray_Typecode *', 'PyObject *'),\n\n\n    (r\"\"\"Where\n    \"\"\",\n      'Where', 'PyObject *, PyObject *, PyObject *', 'PyObject *'),\n\n    (r\"\"\"Arange\n    \"\"\",\n     'Arange', 'double, double, double, int', 'PyObject *')\n    \n    ]\n\n\ntypes = ['Generic','Numeric','Integer','SignedInteger','UnsignedInteger', 'Inexact',\n         'Floating', 'Complex', 'Flexible', 'Character',\n         'Bool','Byte','Short','Int', 'Long', 'LongLong', 'UByte', 'UShort',\n         'UInt', 'ULong', 'ULongLong', 'Float', 'Double', 'LongDouble',\n         'CFloat', 'CDouble', 'CLongDouble', 'Object', 'String', 'Unicode',\n         'Void']\n\n# API fixes for __arrayobject_api.h\n\nfixed = 5\nnumtypes = len(types) + fixed\nnumobject = len(objectapi_list) + numtypes\nnummulti = len(multiapi_list) \nnumtotal = numobject + nummulti\n\n\nmodule_list = []\nextension_list = []\ninit_list = []\n\n# setup types\nfor k, atype in enumerate(types):\n    num = fixed + k\n    astr = \"        (void *) &Py%sArrType_Type,\" % types[k]\n    init_list.append(astr)\n    astr = \"static PyTypeObject Py%sArrType_Type;\" % types[k]\n    module_list.append(astr)\n    astr = \"#define Py%sArrType_Type (*(PyTypeObject *)PyArray_API[%d])\" % \\\n           (types[k], num)\n    extension_list.append(astr)\n\n\n#setup object API\nfor k, item in enumerate(objectapi_list):\n    num = numtypes + k\n    astr = \"static %s PyArray_%s \\\\\\n       (%s);\" % \\\n           (item[3],item[1],item[2])\n    module_list.append(astr)\n    astr = \"#define PyArray_%s \\\\\\n        (*(%s (*)(%s)) \\\\\\n\"\\\n           \"         PyArray_API[%d])\" % (item[1],item[3],item[2],num)\n    extension_list.append(astr)\n    astr = \"        (void *) PyArray_%s,\" % item[1]\n    init_list.append(astr)\n\n    \n##outstr = r\"\"\"\n###ifdef _ARRAYOBJECT\n\n##static PyTypeObject PyArray_Type;\n##static PyTypeObject PyArrayIter_Type;\n\n##%s\n\n\n###else\n\n###define PyArray_Type (*(PyTypeObject *)PyArray_API[0])\n###define PyArrayIter_Type (*(PyTypeObject *)PyArray_API[1])\n\n##%s\n\n###endif\n##\"\"\" % ('\\n'.join(module_list), '\\n'.join(extension_list))\n\n### Write out to header\n##fid = open('__arrayobject_api.h','w')\n##fid.write(outstr)\n##fid.close()\n\n\n##outstr = r\"\"\"\n##/* Export only these pointers */\n\n##void *arrayobject_API[] = {\n##        (void *) &PyArray_Type,\n##        (void *) &PyArrayIter_Type,\n##%s\n##};\n##\"\"\" % '\\n'.join(init_list)\n\n###Write out to c-code\n##fid = open('__arrayobject_api.c','w')\n##fid.write(outstr)\n##fid.close()\n\n\n#module_list = []\n#extension_list = []\n#init_list = []\n\n# setup multiarray module API\nfor k, item in enumerate(multiapi_list):\n    num = numobject + k\n    astr = \"static %s PyArray_%s \\\\\\n       (%s);\" % \\\n           (item[3],item[1],item[2])\n    module_list.append(astr)\n    astr = \"#define PyArray_%s \\\\\\n        (*(%s (*)(%s)) \\\\\\n\"\\\n           \"         PyArray_API[%d])\" % (item[1],item[3],item[2],num)\n    extension_list.append(astr)\n    astr = \"        (void *) PyArray_%s,\" % item[1]\n    init_list.append(astr)\n\n\noutstr = r\"\"\"\n#ifdef _MULTIARRAYMODULE\n\nstatic PyTypeObject PyBigArray_Type;\nstatic PyTypeObject PyArray_Type;\nstatic PyTypeObject PyArrayIter_Type;\nstatic PyTypeObject PyArrayMapIter_Type;\nstatic int PyArray_NUMUSERTYPES=0;\n\n%s\n\n#else\n\nstatic void **PyArray_API=NULL;\n\n#define PyBigArray_Type (*(PyTypeObject *)PyArray_API[0])\n#define PyArray_Type (*(PyTypeObject *)PyArray_API[1])\n#define PyArrayIter_Type (*(PyTypeObject *)PyArray_API[2])\n#define PyArrayMapIter_Type (*(PyTypeObject *)PyArray_API[3])\n#define PyArray_NUMUSERTYPES (*(int *)PyArray_API[4])\n\n%s\n\nstatic int\nimport_array(void) \n{ \n  PyObject *numpy = PyImport_ImportModule(\"scipy.base.multiarray\");\n  PyObject *c_api = NULL;\n  if (numpy == NULL) return -1;\n  c_api = PyObject_GetAttrString(numpy, \"_ARRAY_API\");\n  if (c_api == NULL) {Py_DECREF(numpy); return -1;}\n  if (PyCObject_Check(c_api)) { \n      PyArray_API = (void **)PyCObject_AsVoidPtr(c_api); \n  }\n  Py_DECREF(c_api);\n  Py_DECREF(numpy);\n  if (PyArray_API == NULL) return -1;\n  return 0;\n}\n\n#endif\n\n\"\"\" % ('\\n'.join(module_list), \n       '\\n'.join(extension_list))\n\n# Write to header\nfid = open('__multiarray_api.h','w')\nfid.write(outstr)\nfid.close()\n\n\noutstr = r\"\"\"\n/* These pointers will be stored in the C-object for use in other\n    extension modules\n*/\n\nvoid *PyArray_API[] = {\n        (void *) &PyBigArray_Type,\n        (void *) &PyArray_Type,\n        (void *) &PyArrayIter_Type,\n        (void *) &PyArrayMapIter_Type,\n        (int *) &PyArray_NUMUSERTYPES,\n%s\n};\n\"\"\" % '\\n'.join(init_list)\n\n# Write to c-code\nfid = open('__multiarray_api.c','w')\nfid.write(outstr)\nfid.close()\n\n\n\n\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 492,
                "complexity": 0,
                "token_count": 1714,
                "diff_parsed": {
                    "added": [
                        "    no copy is done, just a new reference created.",
                        "    Base-class ndarray is returned.",
                        "    (r\"\"\"Construct an array from an arbitrary Python Object.",
                        "    Last two integers are min_dimensions, and max_dimensions.",
                        "    If max_dimensions = 0, then any number of dimensions are allowed.",
                        "    Fix the dimension by setting min_dimension == max_dimension.",
                        "    If the array is already contiguous (and aligned and not swapped)",
                        "    no copy is done, just a new reference created.  Subclasses",
                        "    passed through.",
                        "    \"\"\",",
                        "     'ContiguousFromAny',",
                        "     'PyObject *, int typenum, int, int',",
                        "     'PyObject *'),",
                        "",
                        ""
                    ],
                    "deleted": [
                        "    no copy is done, just a new reference created."
                    ]
                }
            },
            {
                "old_path": "scipy/base/numeric.py",
                "new_path": "scipy/base/numeric.py",
                "filename": "numeric.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -97,8 +97,8 @@ def outer(a,b):\n       result(i,j) = a(i)*b(j) when a and b are vectors\n       Will accept any arguments that can be made into vectors.\n    \"\"\"\n-   a = asndarray(a)\n-   b = asndarray(b)\n+   a = asarray(a)\n+   b = asarray(b)\n    return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n \n def vdot(a, b):\n@@ -136,8 +136,8 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n     the z-component of the equivalent three-dimensional cross product is\n     returned.\n     \"\"\"\n-    a = _move_axis_to_0(asndarray(a), axisa)\n-    b = _move_axis_to_0(asndarray(b), axisb)\n+    a = _move_axis_to_0(asarray(a), axisa)\n+    b = _move_axis_to_0(asarray(b), axisb)\n     msg = \"incompatible dimensions for cross product\\n\"\\\n           \"(dimension must be 2 or 3)\"\n     if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n",
                "added_lines": 4,
                "deleted_lines": 4,
                "source_code": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None, fortran=False):\n    \"\"\"returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran)\n\ndef asanyarray(a, dtype=None,copy=0,fortran=False):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asarray(a)\n   b = asarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asarray(a), axisa)\n    b = _move_axis_to_0(asarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "source_code_before": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None, fortran=False):\n    \"\"\"returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran)\n\ndef asanyarray(a, dtype=None,copy=0,fortran=False):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asndarray(a)\n   b = asndarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asndarray(a), axisa)\n    b = _move_axis_to_0(asndarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "methods": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "a",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None , copy = 0 , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 37,
                        "parameters": [
                            "a",
                            "dtype",
                            "copy",
                            "fortran"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 42,
                        "end_line": 43,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 71,
                        "end_line": 74,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 76,
                        "end_line": 78,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 81,
                        "end_line": 89,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 104,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 116,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 118,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 122,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 182,
                        "end_line": 198,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 210,
                        "end_line": 218,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 220,
                        "end_line": 230,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 237,
                        "end_line": 240,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 246,
                        "end_line": 253,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 255,
                        "end_line": 261,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 263,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 287,
                        "end_line": 306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 310,
                        "end_line": 327,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 329,
                        "end_line": 343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 347,
                        "end_line": 358,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "a",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None , copy = 0 , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 37,
                        "parameters": [
                            "a",
                            "dtype",
                            "copy",
                            "fortran"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 42,
                        "end_line": 43,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 71,
                        "end_line": 74,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 76,
                        "end_line": 78,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 81,
                        "end_line": 89,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 104,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 116,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 118,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 122,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 182,
                        "end_line": 198,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 210,
                        "end_line": 218,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 220,
                        "end_line": 230,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 237,
                        "end_line": 240,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 246,
                        "end_line": 253,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 255,
                        "end_line": 261,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 263,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 287,
                        "end_line": 306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 310,
                        "end_line": 327,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 329,
                        "end_line": 343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 347,
                        "end_line": 358,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 240,
                "complexity": 64,
                "token_count": 1957,
                "diff_parsed": {
                    "added": [
                        "   a = asarray(a)",
                        "   b = asarray(b)",
                        "    a = _move_axis_to_0(asarray(a), axisa)",
                        "    b = _move_axis_to_0(asarray(b), axisb)"
                    ],
                    "deleted": [
                        "   a = asndarray(a)",
                        "   b = asndarray(b)",
                        "    a = _move_axis_to_0(asndarray(a), axisa)",
                        "    b = _move_axis_to_0(asndarray(b), axisb)"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/_compiled_base.c",
                "new_path": "scipy/base/src/_compiled_base.c",
                "filename": "_compiled_base.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -100,7 +100,7 @@ arr_bincount(PyObject *self, PyObject *args, PyObject *kwds)\n \n     Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"O|O\", kwlist,\n \t\t\t\t       &list, &weight));\n-    Py_Try(lst = PyArray_ContiguousFromObject(list, PyArray_INTP, 1, 1));\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@@ -116,8 +116,8 @@ arr_bincount(PyObject *self, PyObject *args, PyObject *kwds)\n \tPy_DECREF(lst);\n     }\n     else {\n-\tPy_Try(wts = PyArray_ContiguousFromObject(weight, \n-\t\t\t\t\t\t  PyArray_DOUBLE, 1, 1));\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",
                "added_lines": 3,
                "deleted_lines": 3,
                "source_code": "#include \"Python.h\"\n#include \"scipy/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\nstatic char arr_bincount__doc__[] = \"\";\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_Typecode type = {PyArray_INTP, 0, 0};\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    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      \"First argument of bincount must be nonnegative.\");\n    ans_size = numbers [mxi] + 1 ;\n    if (weight == Py_None) {\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, &type));\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.type_num = PyArray_DOUBLE;\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, &type));\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    return NULL;\n}\n\nstatic char arr_digitize__doc__[] = \"\";\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;\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_Typecode type = {PyArray_DOUBLE, sizeof(double), 0};\n\n    Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"OO\", kwlist, \n\t\t\t\t       &ox, &obins));\n\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 nonzero length.\");\n    \n    if (lbins == 1)  {\n\tfor (i=0 ; i<lx ; i++)\n            if (dx [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 montonic 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    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*avalscast=NULL, *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\treturn NULL;\n\n    \n    amask = (PyArrayObject *) PyArray_FROM_OF(mask, CARRAY_FLAGS);\n    if (amask == NULL) return NULL;\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_ValueError, \n\t\t\t\"Mask array must be 1D or same shape as input array.\");\n\tgoto fail;\n    }\n\n    avals = (PyArrayObject *)PyArray_FromObject(vals, PyArray_NOTYPE, 0, 1);\n    if (avals == NULL) goto fail;\n    avalscast = (PyArrayObject *)PyArray_Cast(avals, ainput->descr->type_num);\n    if (avalscast == NULL) goto fail;\n    Py_DECREF(avals);\n\n    numvals = PyArray_SIZE(avalscast);\n    nd = ainput->nd;\n    input_data = ainput->data;\n    mptr = amask->data;\n    melsize = amask->descr->elsize;\n    vptr = avalscast->data;\n    delsize = avalscast->descr->elsize;\n    zero = PyArray_Zero(amask);\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(avalscast);\n\tPy_INCREF(Py_None);\n\tPyDataMem_FREE(zero);\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 = avalscast->data;\n\t}\n\tmptr += melsize;\n    }\n\n    Py_DECREF(amask);\n    Py_DECREF(avalscast);\n    Py_INCREF(Py_None);\n    PyDataMem_FREE(zero);\n    return Py_None;\n  \n fail:\n    PyDataMem_FREE(zero);\n    Py_XDECREF(amask);\n    Py_XDECREF(avals);\n    Py_XDECREF(avalscast);\n    return NULL;\n}\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, arr_bincount__doc__},\n     {\"digitize\", (PyCFunction)arr_digitize, METH_VARARGS | METH_KEYWORDS,\n     arr_digitize__doc__},\n    {NULL, NULL}    /* sentinel */\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(\"scipy.base._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.4\");\n    PyDict_SetItemString(d, \"__version__\", s);\n    Py_DECREF(s);\n\n    ErrorObject = PyString_FromString(\"scipy.base._compiled_base.error\");\n    PyDict_SetItemString(d, \"error\", ErrorObject);\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 \"scipy/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\nstatic char arr_bincount__doc__[] = \"\";\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_Typecode type = {PyArray_INTP, 0, 0};\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    Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"O|O\", kwlist,\n\t\t\t\t       &list, &weight));\n    Py_Try(lst = PyArray_ContiguousFromObject(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      \"First argument of bincount must be nonnegative.\");\n    ans_size = numbers [mxi] + 1 ;\n    if (weight == Py_None) {\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, &type));\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\tPy_Try(wts = PyArray_ContiguousFromObject(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.type_num = PyArray_DOUBLE;\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, &type));\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    return NULL;\n}\n\nstatic char arr_digitize__doc__[] = \"\";\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;\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_Typecode type = {PyArray_DOUBLE, sizeof(double), 0};\n\n    Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"OO\", kwlist, \n\t\t\t\t       &ox, &obins));\n\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 nonzero length.\");\n    \n    if (lbins == 1)  {\n\tfor (i=0 ; i<lx ; i++)\n            if (dx [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 montonic 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    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*avalscast=NULL, *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\treturn NULL;\n\n    \n    amask = (PyArrayObject *) PyArray_FROM_OF(mask, CARRAY_FLAGS);\n    if (amask == NULL) return NULL;\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_ValueError, \n\t\t\t\"Mask array must be 1D or same shape as input array.\");\n\tgoto fail;\n    }\n\n    avals = (PyArrayObject *)PyArray_FromObject(vals, PyArray_NOTYPE, 0, 1);\n    if (avals == NULL) goto fail;\n    avalscast = (PyArrayObject *)PyArray_Cast(avals, ainput->descr->type_num);\n    if (avalscast == NULL) goto fail;\n    Py_DECREF(avals);\n\n    numvals = PyArray_SIZE(avalscast);\n    nd = ainput->nd;\n    input_data = ainput->data;\n    mptr = amask->data;\n    melsize = amask->descr->elsize;\n    vptr = avalscast->data;\n    delsize = avalscast->descr->elsize;\n    zero = PyArray_Zero(amask);\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(avalscast);\n\tPy_INCREF(Py_None);\n\tPyDataMem_FREE(zero);\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 = avalscast->data;\n\t}\n\tmptr += melsize;\n    }\n\n    Py_DECREF(amask);\n    Py_DECREF(avalscast);\n    Py_INCREF(Py_None);\n    PyDataMem_FREE(zero);\n    return Py_None;\n  \n fail:\n    PyDataMem_FREE(zero);\n    Py_XDECREF(amask);\n    Py_XDECREF(avals);\n    Py_XDECREF(avalscast);\n    return NULL;\n}\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, arr_bincount__doc__},\n     {\"digitize\", (PyCFunction)arr_digitize, METH_VARARGS | METH_KEYWORDS,\n     arr_digitize__doc__},\n    {NULL, NULL}    /* sentinel */\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(\"scipy.base._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.4\");\n    PyDict_SetItemString(d, \"__version__\", s);\n    Py_DECREF(s);\n\n    ErrorObject = PyString_FromString(\"scipy.base._compiled_base.error\");\n    PyDict_SetItemString(d, \"error\", ErrorObject);\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": 12,
                        "end_line": 19,
                        "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": 22,
                        "end_line": 29,
                        "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": 32,
                        "end_line": 47,
                        "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": 47,
                        "complexity": 4,
                        "token_count": 385,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 80,
                        "end_line": 139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arr_digitize",
                        "long_name": "arr_digitize( PyObject * self , PyObject * args , PyObject * kwds)",
                        "filename": "_compiled_base.c",
                        "nloc": 49,
                        "complexity": 9,
                        "token_count": 397,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 144,
                        "end_line": 206,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 723,
                        "parameters": [
                            "self",
                            "args",
                            "kwdict"
                        ],
                        "start_line": 213,
                        "end_line": 334,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "init_compiled_base",
                        "long_name": "init_compiled_base()",
                        "filename": "_compiled_base.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 83,
                        "parameters": [],
                        "start_line": 349,
                        "end_line": 371,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 12,
                        "end_line": 19,
                        "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": 22,
                        "end_line": 29,
                        "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": 32,
                        "end_line": 47,
                        "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": 47,
                        "complexity": 4,
                        "token_count": 385,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 80,
                        "end_line": 139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arr_digitize",
                        "long_name": "arr_digitize( PyObject * self , PyObject * args , PyObject * kwds)",
                        "filename": "_compiled_base.c",
                        "nloc": 49,
                        "complexity": 9,
                        "token_count": 397,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 144,
                        "end_line": 206,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 723,
                        "parameters": [
                            "self",
                            "args",
                            "kwdict"
                        ],
                        "start_line": 213,
                        "end_line": 334,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "init_compiled_base",
                        "long_name": "init_compiled_base()",
                        "filename": "_compiled_base.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 83,
                        "parameters": [],
                        "start_line": 349,
                        "end_line": 371,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "arr_bincount",
                        "long_name": "arr_bincount( PyObject * self , PyObject * args , PyObject * kwds)",
                        "filename": "_compiled_base.c",
                        "nloc": 47,
                        "complexity": 4,
                        "token_count": 385,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 80,
                        "end_line": 139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 280,
                "complexity": 54,
                "token_count": 2029,
                "diff_parsed": {
                    "added": [
                        "    Py_Try(lst = PyArray_ContiguousFromAny(list, PyArray_INTP, 1, 1));",
                        "\t    Py_Try(wts = PyArray_ContiguousFromAny(weight,",
                        "\t\t\t\t\t\t   PyArray_DOUBLE, 1, 1));"
                    ],
                    "deleted": [
                        "    Py_Try(lst = PyArray_ContiguousFromObject(list, PyArray_INTP, 1, 1));",
                        "\tPy_Try(wts = PyArray_ContiguousFromObject(weight,",
                        "\t\t\t\t\t\t  PyArray_DOUBLE, 1, 1));"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/arrayobject.c",
                "new_path": "scipy/base/src/arrayobject.c",
                "filename": "arrayobject.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -5534,6 +5534,15 @@ PyArray_CopyFromObject(PyObject *op, int type, int min_depth,\n \n /* End of deprecated */\n \n+static PyObject *\n+PyArray_ContiguousFromAny(PyObject *op, int type, int min_depth, \n+\t\t\t  int max_depth)\n+{\n+\tPyArray_Typecode typecode = {0,0,0};\n+\ttypecode.type_num = type;\n+        return PyArray_FromAny(op, &typecode, min_depth,\n+\t\t\t       max_depth, DEFAULT_FLAGS);\n+}\t\n \n static int \n PyArray_CanCastSafely(int fromtype, int totype) \n",
                "added_lines": 9,
                "deleted_lines": 0,
                "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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\nstatic PyObject *\nPyArray_ContiguousFromAny(PyObject *op, int type, int min_depth, \n\t\t\t  int max_depth)\n{\n\tPyArray_Typecode typecode = {0,0,0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS);\n}\t\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\n\n",
                "methods": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3287,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3292,
                        "end_line": 3397,
                        "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": 3401,
                        "end_line": 3418,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3422,
                        "end_line": 3537,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3544,
                        "end_line": 3547,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3550,
                        "end_line": 3560,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3633,
                        "end_line": 3636,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3640,
                        "end_line": 3674,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3678,
                        "end_line": 3681,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3684,
                        "end_line": 3717,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3721,
                        "end_line": 3728,
                        "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": 3731,
                        "end_line": 3739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3743,
                        "end_line": 3757,
                        "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": 3760,
                        "end_line": 3804,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3808,
                        "end_line": 3811,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3814,
                        "end_line": 3821,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3825,
                        "end_line": 3832,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3835,
                        "end_line": 3855,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3858,
                        "end_line": 3880,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3883,
                        "end_line": 3886,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3890,
                        "end_line": 3893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3905,
                        "end_line": 3963,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3968,
                        "end_line": 3978,
                        "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": 3982,
                        "end_line": 4007,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4011,
                        "end_line": 4043,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4046,
                        "end_line": 4081,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4084,
                        "end_line": 4121,
                        "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": 4124,
                        "end_line": 4127,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4130,
                        "end_line": 4184,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4363,
                        "end_line": 4388,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4391,
                        "end_line": 4413,
                        "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": 4420,
                        "end_line": 4446,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4449,
                        "end_line": 4469,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4472,
                        "end_line": 4613,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4616,
                        "end_line": 4639,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4643,
                        "end_line": 4666,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4670,
                        "end_line": 4727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4731,
                        "end_line": 4738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4744,
                        "end_line": 4834,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4840,
                        "end_line": 4851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4854,
                        "end_line": 4889,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4896,
                        "end_line": 4942,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4945,
                        "end_line": 5076,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5080,
                        "end_line": 5185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5188,
                        "end_line": 5283,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5286,
                        "end_line": 5307,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5311,
                        "end_line": 5373,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5376,
                        "end_line": 5381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5384,
                        "end_line": 5390,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5444,
                        "end_line": 5474,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5485,
                        "end_line": 5501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5507,
                        "end_line": 5513,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5516,
                        "end_line": 5523,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5526,
                        "end_line": 5533,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromAny",
                        "long_name": "PyArray_ContiguousFromAny( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5538,
                        "end_line": 5545,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5548,
                        "end_line": 5631,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5634,
                        "end_line": 5658,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5668,
                        "end_line": 5705,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5710,
                        "end_line": 5720,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5723,
                        "end_line": 5728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5731,
                        "end_line": 5736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5740,
                        "end_line": 5743,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5747,
                        "end_line": 5795,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5798,
                        "end_line": 5851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5855,
                        "end_line": 5974,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5978,
                        "end_line": 6010,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6013,
                        "end_line": 6055,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6059,
                        "end_line": 6181,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6194,
                        "end_line": 6236,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6241,
                        "end_line": 6245,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6310,
                        "end_line": 6371,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6379,
                        "end_line": 6394,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6400,
                        "end_line": 6469,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6473,
                        "end_line": 6509,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6515,
                        "end_line": 6559,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6577,
                        "end_line": 6713,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6719,
                        "end_line": 6788,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6791,
                        "end_line": 6924,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6930,
                        "end_line": 6960,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6966,
                        "end_line": 6977,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6980,
                        "end_line": 6989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6992,
                        "end_line": 7010,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3287,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3292,
                        "end_line": 3397,
                        "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": 3401,
                        "end_line": 3418,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3422,
                        "end_line": 3537,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3544,
                        "end_line": 3547,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3550,
                        "end_line": 3560,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3633,
                        "end_line": 3636,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3640,
                        "end_line": 3674,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3678,
                        "end_line": 3681,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3684,
                        "end_line": 3717,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3721,
                        "end_line": 3728,
                        "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": 3731,
                        "end_line": 3739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3743,
                        "end_line": 3757,
                        "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": 3760,
                        "end_line": 3804,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3808,
                        "end_line": 3811,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3814,
                        "end_line": 3821,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3825,
                        "end_line": 3832,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3835,
                        "end_line": 3855,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3858,
                        "end_line": 3880,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3883,
                        "end_line": 3886,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3890,
                        "end_line": 3893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3905,
                        "end_line": 3963,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3968,
                        "end_line": 3978,
                        "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": 3982,
                        "end_line": 4007,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4011,
                        "end_line": 4043,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4046,
                        "end_line": 4081,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4084,
                        "end_line": 4121,
                        "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": 4124,
                        "end_line": 4127,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4130,
                        "end_line": 4184,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4363,
                        "end_line": 4388,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4391,
                        "end_line": 4413,
                        "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": 4420,
                        "end_line": 4446,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4449,
                        "end_line": 4469,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4472,
                        "end_line": 4613,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4616,
                        "end_line": 4639,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4643,
                        "end_line": 4666,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4670,
                        "end_line": 4727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4731,
                        "end_line": 4738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4744,
                        "end_line": 4834,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4840,
                        "end_line": 4851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4854,
                        "end_line": 4889,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4896,
                        "end_line": 4942,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4945,
                        "end_line": 5076,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5080,
                        "end_line": 5185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5188,
                        "end_line": 5283,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5286,
                        "end_line": 5307,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5311,
                        "end_line": 5373,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5376,
                        "end_line": 5381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5384,
                        "end_line": 5390,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5444,
                        "end_line": 5474,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5485,
                        "end_line": 5501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5507,
                        "end_line": 5513,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5516,
                        "end_line": 5523,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5526,
                        "end_line": 5533,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5539,
                        "end_line": 5622,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5625,
                        "end_line": 5649,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5659,
                        "end_line": 5696,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5701,
                        "end_line": 5711,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5714,
                        "end_line": 5719,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5722,
                        "end_line": 5727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5731,
                        "end_line": 5734,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5738,
                        "end_line": 5786,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5789,
                        "end_line": 5842,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5846,
                        "end_line": 5965,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5969,
                        "end_line": 6001,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6004,
                        "end_line": 6046,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6050,
                        "end_line": 6172,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6185,
                        "end_line": 6227,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6232,
                        "end_line": 6236,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6301,
                        "end_line": 6362,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6370,
                        "end_line": 6385,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6391,
                        "end_line": 6460,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6464,
                        "end_line": 6500,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6506,
                        "end_line": 6550,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6568,
                        "end_line": 6704,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6710,
                        "end_line": 6779,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6782,
                        "end_line": 6915,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6921,
                        "end_line": 6951,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6957,
                        "end_line": 6968,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6971,
                        "end_line": 6980,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6983,
                        "end_line": 7001,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "PyArray_ContiguousFromAny",
                        "long_name": "PyArray_ContiguousFromAny( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5538,
                        "end_line": 5545,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 5557,
                "complexity": 1221,
                "token_count": 33273,
                "diff_parsed": {
                    "added": [
                        "static PyObject *",
                        "PyArray_ContiguousFromAny(PyObject *op, int type, int min_depth,",
                        "\t\t\t  int max_depth)",
                        "{",
                        "\tPyArray_Typecode typecode = {0,0,0};",
                        "\ttypecode.type_num = type;",
                        "        return PyArray_FromAny(op, &typecode, min_depth,",
                        "\t\t\t       max_depth, DEFAULT_FLAGS);",
                        "}"
                    ],
                    "deleted": []
                }
            },
            {
                "old_path": "scipy/base/src/multiarraymodule.c",
                "new_path": "scipy/base/src/multiarraymodule.c",
                "filename": "multiarraymodule.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -1199,7 +1199,7 @@ PyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\n \tPyArrayObject *ret=NULL;\n \tchar *new_data, *old_data;\n \n-\trepeats = (PyAO *)PyArray_ContiguousFromObject(op, PyArray_INTP, 0, 1);\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@@ -1325,12 +1325,12 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op) {\n \t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n \t\t\tgoto fail;\n \t\tmps[i] = (PyArrayObject*)\n-\t\t\tPyArray_ContiguousFromObject(otmp, type_num, \n+\t\t\tPyArray_ContiguousFromAny(otmp, type_num, \n \t\t\t\t\t\t     0, 0);\n \t\tPy_DECREF(otmp);\n \t}\n \t\n-\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)ip, \n+\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ip, \n \t\t\t\t\t\t\t   PyArray_INTP, \n \t\t\t\t\t\t\t   0, 0);\n \tif (ap == NULL) goto fail;\n@@ -1508,7 +1508,7 @@ PyArray_ArgSort(PyArrayObject *op, int axis)\n \n \tSWAPAXES(op, ap);\n \n-\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op, \n+\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op, \n \t\t\t\t\t\t\t   PyArray_NOTYPE,\n \t\t\t\t\t\t\t   1, 0);\n \tPy_DECREF(op);\n@@ -1611,11 +1611,11 @@ PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2)\n \ttypenum = PyArray_ObjectType((PyObject *)op1, 0);\n \ttypenum = PyArray_ObjectType(op2, typenum);\n \tret = NULL;\n-\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op1, \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_ContiguousFromObject(op2, typenum, \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@@ -1665,10 +1665,10 @@ PyArray_InnerProduct(PyObject *op1, PyObject *op2)\n \ttypenum = PyArray_ObjectType(op2, typenum);\n \t\t\n \tret = NULL;\n-\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \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_ContiguousFromObject(op2, typenum, \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@@ -1769,16 +1769,18 @@ PyArray_MatrixProduct(PyObject *op1, PyObject *op2)\n \tintp matchDim, otherDim, is2r, is1r;\n \tPyTypeObject *subtype;\n         double prior1, prior2;\n+\tPyArray_Typecode typec = {0,0,0};\n         \n \ttypenum = PyArray_ObjectType(op1, 0);  \n \ttypenum = PyArray_ObjectType(op2, typenum);\t\n \t\n+\ttypec.type_num = typenum;\n \tret = NULL;\n-\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n-\t\t\t\t\t\t\t    0, 0);\n+\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 0, 0, \n+\t\t\t\t\t       DEFAULT_FLAGS);\n \tif (ap1 == NULL) return NULL;\n-\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum, \n-\t\t\t\t\t\t\t    0, 0);\n+\tap2 = (PyArrayObject *)PyArray_FromAny(op2, &typec, 0, 0,\n+\t\t\t\t\t       DEFAULT_FLAGS);\n \tif (ap2 == NULL) goto fail;\n \t\n \tif (ap1->nd == 0 || ap2->nd == 0) {\n@@ -1945,16 +1947,18 @@ PyArray_Correlate(PyObject *op1, PyObject *op2, int mode)\n \tint is1, is2, os;\n \tchar *ip1, *ip2, *op;\n \tPyArray_DotFunc *dot;\n+\tPyArray_Typecode typec = {0,0,0};\n \t\n \ttypenum = PyArray_ObjectType(op1, 0);  \n \ttypenum = PyArray_ObjectType(op2, typenum);\n-\t\n+\n+\ttypec.type_num = typenum;\n \tret = NULL;\n-\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n-\t\t\t\t\t\t\t    1, 1);\n+\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n+\t\t\t\t\t       DEFAULT_FLAGS);\n \tif (ap1 == NULL) return NULL;\n-\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum, \n-\t\t\t\t\t\t\t    1, 1);\n+\tap2 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n+\t\t\t\t\t       DEFAULT_FLAGS);\n \tif (ap2 == NULL) goto fail;\n \t\n \tn1 = ap1->dimensions[ap1->nd-1];\n@@ -2132,8 +2136,8 @@ PyArray_ArgMax(PyArrayObject *op, int axis)\n \tSWAPAXES(op, ap);\n \n \tap = (PyArrayObject *)\\\n-\t\tPyArray_ContiguousFromObject((PyObject *)op, \n-\t\t\t\t\t     PyArray_NOTYPE, 1, 0);\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@@ -2189,7 +2193,7 @@ PyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n \tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n         if (self == NULL) return NULL;\n \t\n-        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, \n+        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, \n \t\t\t\t\t\t\t\tPyArray_INTP, \n \t\t\t\t\t\t\t\t1, 0);\n         if (indices == NULL) goto fail;\n@@ -2275,12 +2279,12 @@ PyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0)\n         dest = self->data;\n         chunk = self->itemsize;\n \n-        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, PyArray_INTP, 0, 0);\n+        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);\n         if (indices == NULL) goto fail;\n         ni = PyArray_SIZE(indices);\n \n         values = (PyArrayObject *)\\\n-\t\tPyArray_ContiguousFromObject(values0, self->descr->type_num, \n+\t\tPyArray_ContiguousFromAny(values0, self->descr->type_num, \n \t\t\t\t\t     0, 0);\n         if (values == NULL) goto fail;\n         nv = PyArray_SIZE(values);\n@@ -2335,7 +2339,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0)\n         chunk = self->itemsize;\n \n         mask = (PyArrayObject *)\\\n-\t\tPyArray_ContiguousFromObject(mask0, PyArray_BOOL, 0, 0);\n+\t\tPyArray_ContiguousFromAny(mask0, PyArray_BOOL, 0, 0);\n         if (mask == NULL) goto fail;\n         ni = PyArray_SIZE(mask);\n         if (ni != max_item) {\n@@ -2347,7 +2351,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0)\n \n \tthistype = self->descr->type_num;\n         values = (PyArrayObject *)\\\n-\t\tPyArray_ContiguousFromObject(values0, thistype, 0, 0);\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",
                "added_lines": 28,
                "deleted_lines": 24,
                "source_code": "\n/*\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 scipy_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 <string.h>\n#include <math.h>\n*/\n\n#define _MULTIARRAYMODULE\n#include \"scipy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL;   /* Must be explicitly loaded */\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\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\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\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\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n        int i;\n        for(i=0;i<n;i++) {\n                if (l1[i] != l2[i]) return 0;\n        } \n        return 1;\n}\n\nstatic PyObject *\nPyArray_View(PyArrayObject *self, PyArray_Typecode *type)\n{\n\tPyObject *new=NULL;\n        PyObject *v=NULL;\n        int type_num = PyArray_NOTYPE;\n\n\tif (type) {\n\t\ttype_num = type->type_num;\n\t}\n\n\tnew = PyArray_New(self->ob_type,\n\t\t\t  self->nd, self->dimensions,\n\t\t\t  self->descr->type_num,\n\t\t\t  self->strides,\n\t\t\t  self->data,\n\t\t\t  self->itemsize,\n\t\t\t  self->flags, (PyObject *)self);\n\n\tif (new==NULL) return NULL;\n\t\n        Py_INCREF(self);\n        PyArray_BASE(new) = (PyObject *)self;\n        if ((type_num != PyArray_NOTYPE) &&             \\\n            (type_num != self->descr->type_num)) {\n                if (!PyTypeNum_ISFLEXIBLE(type_num)) {\n                        v = PyArray_TypeObjectFromType(type_num);\n                }\n                else {\n                        PyArray_Descr *descr;\n                        int itemsize = type->itemsize;\n                        descr = PyArray_DescrFromType(type_num);\n                        if (type_num == PyArray_UNICODE) \n                                itemsize /= sizeof(Py_UNICODE);\n                        /* construct a string representation */\n                        v = PyString_FromFormat(\"%c%d\", descr->type, \n                                                itemsize);\n                }\n                if (v == NULL) goto fail;\n                /* set attribute new.dtype = newtype */\n                if (PyObject_SetAttrString(new, \"dtype\", v) < 0) goto fail;\n                Py_DECREF(v);\n        }\n\treturn new;\t\n\n fail:\n        Py_XDECREF(v);\n        Py_XDECREF(new);\n        return NULL;\n}\n\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n        if (a->nd == 1) {\n                Py_INCREF(a);\n                return (PyObject *)a;\n        }\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) \n\t\treturn PyArray_Newshape(a, &newdim);\n\telse\n\t        return PyArray_Flatten(a, fortran);\n}\n\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tsize = PyArray_SIZE(a);\n\tret = PyArray_New(a->ob_type,\n\t\t\t  1, &size,\n\t\t\t  a->descr->type_num,\n\t\t\t  NULL,\n                          NULL,\n\t\t\t  a->itemsize,\n\t\t\t  0, (PyObject *)a);\n\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\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\n/* Returns a new array \n   with the a new shape from the data\n   in the old array\n*/\n\nstatic PyObject * \nPyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims)\n{\n        intp i, s_original, i_unknown, s_known;\n        intp *dimensions = newdims->ptr;\n        PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n        Bool same;\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<n) {\n                        if (PyArray_DIM(self,i) != dimensions[i]) \n                                same=FALSE;\n                        i++;\n                }\n                if (same) return PyArray_View(self, NULL);\n        }\n\n        if (!PyArray_ISCONTIGUOUS(self)) {\n                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"changing shape only works on contiguous arrays\");\n                return NULL;\n        }\n\t\n        s_known = 1;\n        i_unknown = -1;\n\n        for(i=0; i<n; i++) {\n                if (dimensions[i] < 0) {\n                        if (i_unknown == -1) {\n                                i_unknown = i;\n                        } else {\n                                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"can only specify one \"\t\\\n\t\t\t\t\t\t\" unknown dimension\");\n                                goto fail;\n                        }\n                } else {\n\t\t\ts_known *= dimensions[i];\n                }\n        }\n\t\n        s_original = PyArray_SIZE(self);\n\t\n        if (i_unknown >= 0) {\n                if ((s_known == 0) || (s_original % s_known != 0)) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n                dimensions[i_unknown] = s_original/s_known;\n        } else {\n                if (s_original != s_known) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n        }\n        \n\tret = (PyAO *)PyArray_New(self->ob_type,\n\t\t\t\t  n, dimensions,\n\t\t\t\t  self->descr->type_num,\n\t\t\t\t  NULL,\n\t\t\t\t  self->data,\n\t\t\t\t  self->itemsize,\n\t\t\t\t  self->flags, (PyObject *)self);\n\n\tif (ret== NULL)\n                goto fail;\n\t\n        Py_INCREF(self);\n        ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n        return (PyObject *)ret;\n\t\n fail:\n        return NULL;\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\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; i<nd; i++) {\n\t\tif (self->dimensions[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\tret = PyArray_New(self->ob_type, newnd, dimensions, \n\t\t\t  self->descr->type_num, strides,\n\t\t\t  self->data, self->itemsize, self->flags,\n\t\t\t  (PyObject *)self);\n\tself->flags &= ~OWN_DATA;\n\tself->base = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\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\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype)\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; i<n; i++) {\n\t\tif (i==axis) val = 1;\n\t\telse val = PyArray_DIM(new,i);\n\t\tPyTuple_SET_ITEM(newshape, i, PyInt_FromLong((long)val));\n\t}\n\tobj2 = PyArray_Reshape((PyAO *)obj1, newshape);\n\tPy_DECREF(obj1);\n\tPy_DECREF(newshape);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x = x - mx */\n\tobj1 = PyNumber_Subtract((PyObject *)self, obj2);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x * x */\n\tobj2 = PyNumber_Multiply(obj1, obj1);\n\tPy_DECREF(obj1);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute add.reduce(x*x,axis) */\n\tobj1 = PyArray_GenericReduceFunction((PyArrayObject *)obj2, n_ops.add,\n\t\t\t\t\t     axis, rtype);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\tn = PyArray_DIM(new,axis)-1;\n\tPy_DECREF(new);\n\tif (n==0) n=1;\n\tobj2 = PyFloat_FromDouble(1.0/((double )n));\n\tif (obj2 == NULL) {Py_DECREF(obj1); return NULL;}\n\tret = PyArray_EnsureArray(PyNumber_Multiply(obj1, obj2));\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\n\t/* sqrt() */\n\tobj1 = PyArray_GenericUnaryFunction((PyAO *)ret, n_ops.sqrt);\n\tPy_DECREF(ret);\n\n\treturn obj1;\n}\n\n\nstatic PyObject *\nPyArray_Sum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis, \n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Prod(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.multiply, axis,\n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumSum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumProd(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, \n\t\t\t\t\t\tn_ops.multiply, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Any(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_or, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_All(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_and, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Compress(PyArrayObject *self, PyObject *condition, int axis)\n{\n        PyArrayObject *cond;\n\tPyObject *res, *ret;\n\n        cond = (PyAO *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n        if (cond == NULL) return NULL;\n        \n        if (cond->nd != 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\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; i<size; i++) {\n\t\tif (self->descr->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; i<size; i++) {\n\t\t\tif (self->descr->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; j<n; j++) {\n\t\t\titem = PyArray_New(self->ob_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\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tif (item == NULL) goto fail;\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; i<size; i++) {\n\t\t\tif (self->descr->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; j<n; j++) \n\t\t\t\t\t*(dptr[j])++ = it->coordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n        \n}\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)) goto fail;\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) goto fail;\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(res1);\n\tPy_XDECREF(res2);\n\tPy_XDECREF(two);\n\tPy_XDECREF(selector);\n\treturn NULL;\n}\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_Copy(self);\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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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\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\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyObject *newaxes;\n\tint i, pos;\t\n\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 = PyTuple_New(n);\n\tif (newaxes==NULL) return NULL;\n\t/* insert at the end */\n\tPyTuple_SET_ITEM(newaxes, n-2, PyInt_FromLong((long)axis1));\n\tPyTuple_SET_ITEM(newaxes, n-1, PyInt_FromLong((long)axis2));\n\tpos = 0;\n\tfor (i=0; i<n; i++) {\n\t\tif ((i==axis1) || (i==axis2)) continue;\n\t\tPyTuple_SET_ITEM(newaxes, pos++, \n\t\t\t\t PyInt_FromLong((long) i));\n\t}\n\tnew = PyArray_Transpose(self, newaxes);\n\tPy_DECREF(newaxes);\n\tif (new == NULL) return NULL;\n\tself = (PyAO *)new;\n\t\n\tif (n == 2) {\n\t\tPyObject *a=NULL, *indices=NULL, *ret=NULL;\n\t\tintp n1, n2, start, stop, step, count;\n\t\tintp *dptr;\n\t\tn1 = self->dimensions[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; n1<stop; n1+=step) *dptr++ = n1;\n\t\ta = PyArray_IterNew((PyObject *)self);\n\t\tPy_DECREF(self);\n\t\tif (a == NULL) {Py_DECREF(indices); return NULL;}\n\t\tret = PyObject_GetItem(a, indices);\n\t\tPy_DECREF(a);\n\t\tPy_DECREF(indices);\n\t\treturn ret;\n\t}\t\n\n\telse {\n\t\t/* \n\t\t   my_diagonal = []\n\t\t   for i in range (s [0]) :\n\t\t       my_diagonal.append (diagonal (a [i], offset))\n\t\t   return array (my_diagonal)\t\n\t\t*/\t\n\t\tPyObject *mydiagonal=NULL, *new=NULL, *ret=NULL, *sel=NULL;\n\t\tintp i, n1;\n\t\tint res;\n\t\tPyArray_Typecode typecode;\n\n\t\ttypecode.type_num = self->descr->type_num;\n\t\ttypecode.itemsize = self->itemsize;\n\t\ttypecode.fortran = 0;\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<n1; i++) {\n\t\t\tnew = PyInt_FromLong((long) i);\n\t\t\tsel = PyArray_EnsureArray(PyObject_GetItem((PyObject *)self, new));\n\t\t\tPy_DECREF(new);\n\t\t\tif (sel == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnew = PyArray_Diagonal((PyAO *)sel, offset, n-3, n-2);\n\t\t\tPy_DECREF(sel);\n\t\t\tif (new == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tres = PyList_Append(mydiagonal, new);\n\t\t\tPy_DECREF(new);\n\t\t\tif (res < 0) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(self);\n\t\tret =  PyArray_FromAny(mydiagonal, &typecode, 0, 0, 0);\n\t\tPy_DECREF(mydiagonal);\n\t\treturn ret;\n\t}\n}\n\n\n\n\n\n\n/* simulates a C-style 1-3 dimensional array which can be accesed using \n    ptr[i]  or ptr[i][j] or ptr[i][j][k] -- requires pointer allocation \n    for 2-d and 3-d.\n\n    Especially for 2-d and up, ptr is NOT equivalent to a statically defined\n    2-d or 3-d array.  In particular, it cannot be passed into a \n    function that requires a true pointer to a fixed-size array. \n*/\n\nstatic int\nPyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, int type_num) \n{\n\tPyArrayObject *ap;\n\tPyArray_Typecode typecode = {0, 0, 0};\n\tintp n, m, i, j;\n\tchar **ptr2;\n\tchar ***ptr3;\n\n\ttypecode.type_num = type_num;\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot treat flexible type as C array.\");\n\t\treturn -1;\n\t}\n\tif ((nd < 1) || (nd > 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"Only Carrays of 1-3 dimensions available.\");\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, &typecode, 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 **)malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr2[i] = ap->data + 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 ***)malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr3[i] = ptr3[n + (m-1)*i];\n\t\t\tfor (j=0; j<m; j++) {\n\t\t\t\tptr3[i][j] = ap->data + 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\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, typecode) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, typecode) == -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\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\tfree(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<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\tarr = PyArray_FROM_O(otmp);\n\t\tPy_DECREF(otmp);\n\t\tif (arr==NULL) goto fail;\n\t\totmp = PyArray_SwapAxes((PyArrayObject *)arr, axis, 0);\n\t\tPy_DECREF(arr);\n\t\tif (otmp == NULL) goto fail;\n\t\tPyTuple_SET_ITEM(newtup, i, otmp);\n\t}\n\totmp = PyArray_Concatenate(newtup, 0);\n\tPy_DECREF(newtup);\n\tif (otmp == NULL) return NULL;\n\tarr = PyArray_SwapAxes((PyArrayObject *)otmp, axis, 0);\n\tPy_DECREF(otmp);\n\treturn arr;\n\t\n fail:\n\tPy_DECREF(newtup);\n\treturn NULL;\n}\n\n/*op is a python object supporting the sequence interface.\n  Its elements will be concatenated together to form a single \n  multidimensional array.*/\n/* If axis is MAX_DIMS or bigger, then each sequence object will \n   be flattened before concatenation \n*/\nstatic PyObject *\nPyArray_Concatenate(PyObject *op, int axis) \n{\n\tPyArrayObject *ret, **mps;\n\tPyObject *otmp;\n\tint i, n, type_num, tmp, nd=0, new_dim;\n\tchar *data;\t\n\tPyTypeObject *subtype;\n\tdouble prior1, prior2;\n\tintp numbytes;\n\n\tn = PySequence_Length(op);\n\tif (n == -1) {\n\t\treturn NULL;\n\t}\n\tif (n == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Concatenation of zero-length sequences is \"\\\n\t\t\t\t\"impossible.\");\n\t\treturn NULL;\n\t}\n\n\tif ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS)))\n\t\treturn _swap_and_concat(op, axis, n);\n\t\n\tret = NULL;\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\t/* Make sure these arrays are legal to concatenate. */\n\t/* Must have same dimensions except d0, and have coercible type. */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays \"\\\n\t\t\t\t\"to concatenate\");\n\t\tgoto fail;\n\t}\n\n\tprior1 = 0.0;\n\tsubtype = &PyArray_Type;\n\tret = NULL;\n\tfor(i=0; i<n; i++) {\n\t\tPyArray_Typecode typecode = {0, 0, 0};\n\t\ttypecode.type_num = type_num;\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) goto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_FromAny(otmp, &typecode, 0, 0, CARRAY_FLAGS);\n\t\tPy_DECREF(otmp);\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (axis >= 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; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (i == 0) nd = mps[i]->nd;\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\"0d 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\tret = (PyArrayObject *)PyArray_New(subtype, nd,\n\t\t\t\t\t   mps[0]->dimensions, \n\t\t\t\t\t   type_num, NULL, NULL, 0, 0,\n                                           (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; i<n; i++) {\n\t\tnumbytes = PyArray_NBYTES(mps[i]);\n\t\tmemcpy(data, mps[i]->data, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)\n{\n\tPyObject *new_axes;\n\tint n, i, val;\n\tPyObject *ret;\n\n\tif (a1 == a2) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\t\n\tn = ap->nd;\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 = PyTuple_New(n);\n\tfor (i=0; i<n; i++) {\n\t\tif (i == a1) val = a2;\n\t\telse if (i == a2) val = a1;\n\t\telse val = i;\n\t\tPyTuple_SET_ITEM(new_axes, i, PyInt_FromLong((long) val));\n\t}\n\tret = PyArray_Transpose(ap, new_axes);\n\tPy_DECREF(new_axes);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Transpose(PyArrayObject *ap, PyObject *op) {\n\tintp *axes, axis;\n\tintp i, n;\n\tintp *permutation = NULL;\n\tPyArrayObject *ret = NULL;\n\t\n\tif (op == Py_None || op == NULL) {\n\t\tn = ap->nd;\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\tfor(i=0; i<n; i++)\n\t\t\tpermutation[i] = n-1-i;\n\t} else {\n\t\tif (PyArray_AsCArray(&op, (char **)&axes, &n, 1,\n\t\t\t\t PyArray_INTP) == -1)\n\t\t\treturn NULL;\n\t\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\n\t\tfor(i=0; i<n; i++) {\n\t\t\taxis = axes[i];\n\t\t\tif (axis < 0) axis = ap->nd+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\tgoto fail;\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\tret = (PyArrayObject *)PyArray_New(ap->ob_type, n, permutation, \n\t\t\t\t\t   ap->descr->type_num, NULL,\n\t\t\t\t\t   ap->data, ap->itemsize, ap->flags,\n\t\t\t\t\t   (PyObject *)ap);\n\tif (ret == NULL) goto fail;\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; i<n; i++) {\n\t\tret->dimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n\tif (op && (op != Py_None))\n\t\tPyArray_Free(op, (char *)axes);\n\tfree(permutation);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tif (permutation != NULL) free(permutation);\n\tif (op != Py_None)\n\t\tPyArray_Free(op, (char *)axes);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\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; j<n; j++) {\n\t\t\tif (counts[j] < 0) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \"count < 0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\ttotal += counts[j];\n\t\t}\n\t}\n\n\n\t/* Construct new array */\n\taop->dimensions[axis] = total;\n\tret = (PyArrayObject *)PyArray_New(aop->ob_type, aop->nd,\n\t\t\t\t\t   aop->dimensions, \n\t\t\t\t\t   aop->descr->type_num,\n\t\t\t\t\t   NULL, NULL, aop->itemsize, 0,\n\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->itemsize;\n\tfor(i=axis+1; i<aop->nd; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; i<axis; i++) n_outer *= aop->dimensions[i];\n\n\tfor(i=0; i<n_outer; i++) {\n\t\tfor(j=0; j<n; j++) {\n\t\t\ttmp = (nd ? counts[j] : counts[0]);\n\t\t\tfor(k=0; k<tmp; k++) {\n\t\t\t\tmemcpy(new_data, old_data, chunk);\n\t\t\t\tnew_data += chunk;\n\t\t\t}\n\t\t\told_data += chunk;\n\t\t}\n\t}\n\n\tPy_DECREF(repeats);\n\tPyArray_INCREF(ret);\n\tPy_XDECREF(aop);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_DECREF(repeats);\n\tPy_XDECREF(aop);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\nstatic PyObject *\nPyArray_Choose(PyArrayObject *ip, PyObject *op) {\n\tintp i, n, *sizes, m, offset, elsize, type_num;\n\tchar *ret_data;\n\tPyArrayObject **mps, *ap, *ret;\n\tPyObject *otmp;\n\tintp *self_data, mi;\n\tap = NULL;\n\tret = NULL;\n\t\n\tn = PySequence_Length(op);\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\tsizes = (intp *)malloc(n*sizeof(intp));\n\t\n\t/* Figure out the right type for the new array */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays to \"\\\n\t\t\t\t\"choose from\");\n\t\tgoto fail;\n\t}\n\t\n\t/* Make sure all arrays are actual array objects. */\n\tfor(i=0; i<n; i++) {\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n\t\t\tgoto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_ContiguousFromAny(otmp, type_num, \n\t\t\t\t\t\t     0, 0);\n\t\tPy_DECREF(otmp);\n\t}\n\t\n\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ip, \n\t\t\t\t\t\t\t   PyArray_INTP, \n\t\t\t\t\t\t\t   0, 0);\n\tif (ap == NULL) goto fail;\n\t\n\t/* Check the dimensions of the arrays */\n\tfor(i=0; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (ap->nd < 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\t/* why not ??? \n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Not implemented for flexible sizes\");\n\t\treturn NULL;\n\t}\n\t*/\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->itemsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i<m; i++) {\n\t\tmi = *self_data;\n\t\tif (mi < 0 || mi >= 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; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_DECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\n\treturn (PyObject *)ret;\n\t\n fail:\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_XDECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\tPy_XDECREF(ret);\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->compare(a,b,global_obj);\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#define SWAPBACK(op, ap) { \\\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\nstatic PyObject *\nPyArray_Sort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tif ((ap = (PyAO*) _check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_CopyFromObject((PyObject *)op, \n\t\t\t\t\t\t     PyArray_NOTYPE,\n\t\t\t\t\t\t     1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\n\tif (ap->descr->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\n\t}\n\t\n\telsize = ap->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\tqsort(ip, m, elsize, qsortCompare);\n\t}\n\t\n\tglobal_obj = store_arr;\n\t\t\n\tif (PyErr_Occurred()) {\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\t\n\t}\n\n finish:\n\tSWAPBACK(op, ap);\n\n\treturn (PyObject *)op;\n}\n\n\nstatic char *global_data;\n\nstatic int \nargsort_static_compare(const void *ip1, const void *ip2) \n{\n\tint isize = global_obj->itemsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->compare(global_data + (isize * *ipa),\n                                          global_data + (isize * *ipb), \n\t\t\t\t\t  global_obj);\n}\n\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap, *ret, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tif ((ap = (PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op, \n\t\t\t\t\t\t\t   PyArray_NOTYPE,\n\t\t\t\t\t\t\t   1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, PyArray_INTP,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\tif (ap->descr->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\tip = (intp *)ret->data;\n\targsort_elsize = ap->itemsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\tstore_ptr = global_data;\n\tglobal_data = ap->data;\n\tstore = global_obj;\n\tglobal_obj = ap;\n\tfor (i=0; i<n; i++, ip+=m, global_data += m*argsort_elsize) {\n\t\tfor(j=0; j<m; j++) ip[j] = j;\n\t\tqsort((char *)ip, m, sizeof(intp),\n\t\t      argsort_static_compare);\n\t}\n\tglobal_data = store_ptr;\n\tglobal_obj = store;\n\n\n finish:\n\tPy_DECREF(ap);\n\tSWAPBACK(op, ret);\n\treturn (PyObject *)op;\n\n fail:\n\tPy_XDECREF(ap);\n\tPy_XDECREF(ret);\n\treturn NULL;\n\n}  \n\nstatic void \nlocal_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret)\n{\t\n\tPyArray_CompareFunc *compare = ap2->descr->compare;\n\tintp  min_i, max_i, i, j;\n\tint location, elsize = ap1->itemsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_Size((PyObject *)ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j<n; j++, ip+=elsize, rp++) {\n\t\tmin_i = 0;\n\t\tmax_i = elements;\n\t\twhile (min_i != max_i) {\n\t\t\ti = (max_i-min_i)/2 + min_i;\n\t\t\tlocation = compare(ip, vp+elsize*i, ap2);\n\t\t\tif (location == 0) {\n\t\t\t\twhile (i > 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\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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->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\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tret = NULL;\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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->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->itemsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2*l;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1*l;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\t\t\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/* just like inner product but does the swapaxes stuff on the fly */\nstatic PyObject *\nPyArray_MatrixProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tintp matchDim, otherDim, is2r, is1r;\n\tPyTypeObject *subtype;\n        double prior1, prior2;\n\tPyArray_Typecode typec = {0,0,0};\n        \n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\t\n\t\n\ttypec.type_num = typenum;\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 0, 0, \n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_FromAny(op2, &typec, 0, 0,\n\t\t\t\t\t       DEFAULT_FLAGS);\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\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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<j; i++) \n\t   fprintf(stderr, \"%d \", dimensions[i]);\n\t   fprintf(stderr, \"\\n\"); \n\t*/\n\n        /* Choose which subtype to return */\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->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->itemsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2r;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1r;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\n\t\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\nstatic PyObject *\nPyArray_CopyAndTranspose(PyObject *op) \n{\n\tPyObject *ret, *arr;\n\tint nd;\n\tintp dims[2];\n\tintp i,j;\n\tint elsize, str2;\n\tchar *iptr;\n\tchar *optr;\n\n\t/* make sure it is well-behaved */\n\tarr = PyArray_FromAny(op, NULL, 0, 0, CARRAY_FLAGS);\n\tnd = PyArray_NDIM(arr);\n\tif (nd == 1) {     /* we will give in to old behavior */\n\t\tret = PyArray_Copy((PyArrayObject *)arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\t\t\n\t}\n\telse if (nd != 2) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Only 2-d arrays are allowed.\");\n\t\treturn NULL;\n\t}\n\n\t/* Now construct output array */\n\tdims[0] = PyArray_DIM(arr,1);\n\tdims[1] = PyArray_DIM(arr,0);\n\telsize = PyArray_ITEMSIZE(arr);\n\n\tret = PyArray_New(arr->ob_type, 2, dims, PyArray_TYPE(arr),\n\t\t\t  NULL, NULL, elsize, 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; i<dims[0]; i++) {\n\t\tiptr = PyArray_DATA(arr) + i*elsize;\n\t\tfor (j=0; j<dims[1]; j++) {\n\t\t\t/* optr[i,j] = iptr[j,i] */\n\t\t\tmemcpy(optr, iptr, elsize);\n\t\t\toptr += elsize;\n\t\t\tiptr += str2;\n\t\t}\n\t}\n\tPy_DECREF(arr);\n\treturn ret;\n}\n \nstatic PyObject *\nPyArray_Correlate(PyObject *op1, PyObject *op2, int mode) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\n\tintp length;\n\tint i, n1, n2, n, n_left, n_right;\n\tint typenum;\n\tint is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tPyArray_DotFunc *dot;\n\tPyArray_Typecode typec = {0,0,0};\n\t\n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\n\ttypec.type_num = typenum;\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap2 == NULL) goto fail;\n\t\n\tn1 = ap1->dimensions[ap1->nd-1];\n\tn2 = ap2->dimensions[ap2->nd-1];\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 = (int)(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\t\n\tret = (PyArrayObject *)PyArray_New(ap1->ob_type, 1,\n\t\t\t\t\t   &length, typenum, \n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)ap1);\n\tif (ret == NULL) goto fail;\n\n\t\n\tdot = ret->descr->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->itemsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; i<n_left; i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tn++;\n\t\tip2 -= is2;\n\t\top += os;\n\t}\n\tfor(i=0; i<(n1-n2+1); i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tfor(i=0; i<n_right; i++) {\n\t\tn--;\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tif (PyErr_Occurred()) goto fail;\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\nstatic PyObject *\nPyArray_ArgMin(PyArrayObject *ap, int axis) \n{\n\tPyObject *obj, *new, *ret;\n\n\tif (PyArray_ISFLEXIBLE(ap)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"argmax is unsupported for this type.\");\n\t\treturn NULL;\n\t}\n\telse if (PyArray_ISUNSIGNED(ap)) \n\t\tobj = PyInt_FromLong((long) -1);\n\t\n\telse if (PyArray_TYPE(ap)==PyArray_BOOL) \n\t\tobj = PyInt_FromLong((long) 1);\n\t\n\telse \n\t\tobj = PyInt_FromLong((long) 0);\n\t\n\tnew = PyNumber_Subtract(obj, (PyObject *)ap);\n\tif (new == NULL) return NULL;\n\n\tPy_DECREF(obj);\n\tret = PyArray_ArgMax((PyArrayObject *)new, axis);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Max(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.maximum, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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\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->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->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\targ_func(ip, m, rptr, ap);\n\t\trptr += 1;\n\t}\n\tPy_DECREF(ap);\n\n\tSWAPBACK(op, rp);     /* op now contains the return */\n  \n\treturn (PyObject *)op;\n\t\n fail:\n\tPy_DECREF(ap);\n\tPy_XDECREF(rp);\n\treturn NULL;\n}  \n\n\nstatic PyObject *\nPyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n        PyArrayObject *self, *indices, *ret;\n        intp nd, i, j, n, m, max_item, tmp, chunk;\n\tintp shape[MAX_DIMS];\n        char *src, *dest;\n\t\n        indices = ret = NULL;\n\tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n        if (self == NULL) return NULL;\n\t\n        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, \n\t\t\t\t\t\t\t\tPyArray_INTP, \n\t\t\t\t\t\t\t\t1, 0);\n        if (indices == NULL) goto fail;\n\t\n        n = m = chunk = 1;\n        nd = self->nd + 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        ret = (PyArrayObject *)PyArray_New(self->ob_type, nd, shape, \n\t\t\t\t\t   self->descr->type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)self);\n\t\n        if (ret == NULL) goto fail;\n\t\n        max_item = self->dimensions[axis];\n        chunk = chunk * ret->itemsize;\n        src = self->data;\n        dest = ret->data;\n\t\n        for(i=0; i<n; i++) {\n                for(j=0; j<m; j++) {\n                        tmp = ((intp *)(indices->data))[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\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0) \n{\n        PyArrayObject  *indices, *values;\n        int i, chunk, ni, max_item, nv, tmp; \n        char *src, *dest;\n\n        indices = NULL;\n        values = NULL;\n\n        if (!PyArray_Check(self)) {\n                PyErr_SetString(PyExc_ValueError, \"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->itemsize;\n\n        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);\n        if (indices == NULL) goto fail;\n        ni = PyArray_SIZE(indices);\n\n        values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, self->descr->type_num, \n\t\t\t\t\t     0, 0);\n        if (values == NULL) goto fail;\n        nv = PyArray_SIZE(values);\n        if (nv > 0) { /* nv == 0 for a null array */\n                for(i=0; i<ni; i++) {\n                        src = values->data + 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        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\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0) \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_ValueError, \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->itemsize;\n\n        mask = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(mask0, PyArray_BOOL, 0, 0);\n        if (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\t\tfor(i=0; i<ni; i++) {\n\t\t\tsrc = values->data + chunk * (i % nv);\n\t\t\ttmp = ((Bool *)(mask->data))[i];\n\t\t\tif (tmp) {\n\t\t\t\tmemmove(dest + i * chunk, src, chunk);\n\t\t\t\tif (thistype == PyArray_OBJECT)\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\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    \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\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{\n\tif (PyObject_IsTrue(object)) *val=TRUE;\n\telse *val=FALSE;\n\tif (PyErr_Occurred()) return PY_FAIL;\n\treturn PY_SUCCEED;\n}\n\n\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (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\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n        int buflen;\n\n        buf->ptr = NULL;\n        buf->flags = WRITEABLE;\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\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) goto fail;\n        return PY_SUCCEED;\n\n fail:\n\tPyDimMem_FREE(seq->ptr);\n\treturn PY_FAIL;\n}\n\n/* This function takes a Python object representing a type and converts it \n   to a C type_num and an itemsize (elements of PyArray_Typecode structure)\n   \n   Many objects can be used to represent a type.\n */\n\nstatic int\nPyArray_TypecodeConverter(PyObject *obj, PyArray_Typecode *at)\n{\n        char *type;\n        PyArray_Descr *descr;\n        int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item, *attr=NULL;\n\n\tat->itemsize = 0;\n        if (obj == Py_None) {\n                at->type_num = PyArray_NOTYPE;\n                return PY_SUCCEED;\n        }\n\n        if (PyType_Check(obj) && PyType_IsSubtype((PyTypeObject *)obj, \n                                                  &PyGenericArrType_Type)) {\n                PyArray_TypecodeFromTypeObject(obj, at);\n                return PY_SUCCEED;\n        }\n\n\n\t/* type object could be an array */\n\tif (PyArray_Check(obj)) {\n\t\tat->type_num = PyArray_TYPE(obj);\n\t\tat->itemsize = PyArray_ITEMSIZE(obj);\n\t\treturn PY_SUCCEED;\n\t}\n\n\t/* or an array scalar */\n        if (PyArray_IsScalar(obj, Generic)) {\n                PyArray_TypecodeFromScalar(obj, at);\n                return PY_SUCCEED;\n        }\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);\t\t\n\t\tif (len > 0) {\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tif (len > 1) {\n\t\t\tat->itemsize = atoi(type+1);\n\t\t\t/* When specifying length of UNICODE\n\t\t\t   the number of characters is given to match \n\t\t\t   the STRING interface.  Each character can be\n\t\t\t   more than one byte and itemsize must be\n\t\t\t   the number of bytes.\n\t\t\t*/\n\t\t\tif (check_num == PyArray_UNICODELTR ||\t\\\n\t\t\t    check_num == PyArray_UNICODE) \n\t\t\t  at->itemsize *= sizeof(Py_UNICODE);\n\n\t\t\t/* Support for generic processing */\n\t\t\telse if ((check_num != PyArray_STRINGLTR) &&\n\t\t\t\t (check_num != PyArray_VOIDLTR) &&\n\t\t\t\t (check_num != PyArray_STRING) &&\n\t\t\t\t (check_num != PyArray_VOID)) {\n\t\t\t\tcheck_num = \\\n\t\t\t\t\tPyArray_TypestrConvert(at->itemsize,\n\t\t\t\t\t\t\t       check_num);\n\t\t\t        at->itemsize = 0;\n\t\t\t\tif (check_num == PyArray_NOTYPE) goto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Arbitray object with dtypenum and itemsize attributes. */\n\telse if (PyObject_HasAttrString(obj, \"dtypenum\") && \n\t    PyObject_HasAttrString(obj, \"itemsize\")) {\n\t\tattr = PyObject_GetAttrString(obj, \"dtypenum\");\n\t\tcheck_num = PyInt_AsLong(attr);\n\t\tif (PyErr_Occurred()) {  /* not an integer, try character */\n\t\t\tPyErr_Clear();\n\t\t\ttype = PyString_AsString(attr);\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tif (!PyErr_Occurred()) {\n\t\t\tattr = PyObject_GetAttrString(obj, \"itemsize\");\n\t\t\tat->itemsize = PyInt_AsLong(attr);\n\t\t\tPy_XDECREF(attr);\n\t\t}\t\t\t\n\t}\t\t\n\telse if (PyType_Check(obj)) {\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 *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\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                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}\t\n        else { /* Default -- try integer conversion */\n                check_num = PyInt_AsLong(obj);\n\t}\n\n\tif (PyErr_Occurred()) goto fail;\n\n\t/*\n\tif (check_num == PyArray_NOTYPE) return PY_FAIL;\n\t*/\n\tif (check_num == PyArray_NOTYPE) {\n\t\tat->type_num = PyArray_NOTYPE;\n\t\tat->itemsize = 0;\n\t\treturn PY_SUCCEED;\n\t}\n\n        if ((descr = PyArray_DescrFromType(check_num))==NULL) {\n\t\t/* Now check to see if the object is registered\n\t\t   in typeDict */\n\t\tif (typeDict != NULL) {\n\t\t\titem = PyDict_GetItem(typeDict, obj);\n\t\t\tif (item) {\n\t\t\t\tPyArray_TypecodeFromTypeObject(obj, at);\n\t\t\t\tPyErr_Clear();\n\t\t\t\treturn PY_SUCCEED;\n\t\t\t}\n\t\t}\n                return PY_FAIL;\n\t}\n\t\n        at->type_num = descr->type_num;\n\tif (at->itemsize == 0) at->itemsize = descr->elsize;\n\t\n        return PY_SUCCEED;\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\treturn PY_FAIL;\n}\t\n\n\n/* This function returns true if the two typecodes are \n   equivalent (same basic kind and same itemsize).\n*/\n\nstatic Bool\nPyArray_EquivalentTypes(PyArray_Typecode *typ1, PyArray_Typecode *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->itemsize;\n\tregister int size2=typ2->itemsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typenum1==typenum2) return TRUE;\n\n\t/* If we are here then size1 == size2 */\n\tif (typenum1 < PyArray_FLOAT) {\n\t\tif (PyTypeNum_ISBOOL(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISBOOL(typenum2));\n\t\telse if (PyTypeNum_ISUNSIGNED(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISUNSIGNED(typenum2));\n\t\telse \n\t\t\treturn (Bool)(PyTypeNum_ISSIGNED(typenum2));\n\t}\n\telse {\n\t\tif (PyTypeNum_ISFLOAT(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISFLOAT(typenum2));\n\t\telse if (PyTypeNum_ISCOMPLEX(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISCOMPLEX(typenum2));\n\t}\n\t/* Default size1 != size2 and typenum1 != typenum2 */\n\treturn FALSE;\t\n}\n\nstatic Bool \nPyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n{\n        PyArray_Typecode type1={0,0,0};\n        PyArray_Typecode type2={0,0,0};\n\n\ttype1.type_num = PyArray_TYPE(a1);\n\ttype2.type_num = PyArray_TYPE(a2);\n\ttype1.itemsize = PyArray_ITEMSIZE(a1);\n\ttype2.itemsize = PyArray_ITEMSIZE(a2);\n\t\t\t\n        return PyArray_EquivalentTypes(&type1, &type2);\n}\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_Typecode type = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n\tint type_num;\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_TypecodeConverter,\n                                        &type, \n\t\t\t\t\tPyArray_BoolConverter, &copy, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n                                        PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\ttype_num = type.type_num;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\\n            (copy==0) &&                                             \\\n\t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n\t\tif (type_num == PyArray_NOTYPE) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t\t/* One more chance */\n\t\toldtype.type_num = PyArray_TYPE(op);\n\t\toldtype.itemsize = PyArray_ITEMSIZE(op);\n\t\tif (PyArray_EquivalentTypes(&oldtype, &type)) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t}\n\n\ttype.fortran = fortran; \n\tif (copy) {\n\t\tflags = ENSURECOPY;\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\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n        \n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Empty(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypestr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. typestr must be a valid data typestr (complete with < > or |).  If dtypestr is object, 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[] = {\"dtypestr\",\"obj\", NULL};\n\tPyArray_Typecode typecode;\n\tPyObject *obj=NULL;\n\tchar *typestr;\n\tint typestrlen;\n\tint swap, alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"z#|O\",\n\t\t\t\t\t kwlist, &typestr, &typestrlen,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\n\tif (_array_typecode_fromstr(typestr, &swap, &typecode) < 0) \n\t\treturn NULL;\n\t\n\tif (typecode.itemsize == 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\tswap = 0;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = malloc(typecode.itemsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode.itemsize);\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_ValueError, \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.itemsize) {\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.type_num,\n\t\t\t     typecode.itemsize, swap); \n\n\t/* free dptr which contains zeros */\n\tif (alloc) free(dptr);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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 {\t\t\n\t\tmemset(ret->data, 0, n*(ret->itemsize));\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Zeros(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return 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\nstatic char doc_fromString[] = \"fromstring(string, dtype=intp, count=-1, swap=False) 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\tPyArrayObject *ret; \n\tchar *data;\n\tlonglong nin=-1;\n\tintp s, n;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", \"swap\",NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint itemsize;\n\tint swapped=FALSE;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&LO&\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &swapped)) {\n\t\treturn NULL;\n\t}\n\t\n\tn = (intp) nin;\n\n\titemsize = type.itemsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize.\");\n\t\treturn NULL;\n\t}\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\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\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\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype.type_num, NULL, \n\t\t\t\t\t\tNULL, itemsize, 0,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*ret->itemsize);\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPyArray_INCREF(ret);\n\treturn (PyObject *)ret;\n}\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\nstatic int\n_fill_in_itemsize(PyArray_Typecode *typecode)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(typecode->type_num);\n\tif (descr==NULL) return -1;\n\ttypecode->itemsize = descr->elsize;\n\treturn 0;\n}\n\n\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Typecode *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\n\tif (typecode->itemsize == 0) {\n\t\tif (_fill_in_itemsize(typecode) < 0) \n\t\t\treturn NULL;\n\t}\n\n\tif (num == -1 && sep == NULL) {  /* 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\tfseek(fp, (long) start, SEEK_SET);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \"Could not seek in file.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif (typecode->itemsize == 0) {\n\t\t\ttypecode->itemsize = numbytes;\n\t\t\tnum = 1;\n\t\t}\n\t\telse {\n\t\t\tnum = numbytes / typecode->itemsize;\n\t\t}\n\t}\n\t\n\tif (sep==NULL) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &num, \n\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t typecode->itemsize, 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->itemsize, 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 = PyArray_DescrFromType(typecode->type_num)->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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &num, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\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, r->itemsize, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->itemsize;\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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &size, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->itemsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, r->itemsize, 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->itemsize;\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->itemsize);\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->itemsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=intp, count=-1, sep='')\\n\"\\\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_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\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, \"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\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Typecode *type, \n\t\t   intp count, int swapped) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\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\treturn NULL;\n\t}\n\tif (type->itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Itemsize cannot be zero in type\");\n\t\treturn NULL;\n\t}\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\treturn NULL;\n\t\t}\n\t}\n\ts = (intp)ts;\t\n\tn = (intp)count;\n\titemsize = type->itemsize;\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\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\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype->type_num, NULL, \n\t\t\t\t\t\tdata, itemsize, DEFAULT_FLAGS,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPy_INCREF(buf);\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret; \t\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=intp, count=-1, swap=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 the buffer has data that is out\\n\" \\\n\t\"   not in machine byte-order, than set swap=1.  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;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", \n\t\t\t\t \"swap\", NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint swapped=0;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Li\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &swapped)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromBuffer(obj, &type, (intp)nin, swapped);\n}\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\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length, i;\n\tPyObject *range;\n\tchar *rptr;\n\tint elsize, type;\n\tdouble value;\n\tPyArray_Descr *dbl_descr;\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\tdbl_descr = PyArray_DescrFromType(PyArray_DOUBLE);\n    \n\trptr = ((PyArrayObject *)range)->data;\n\telsize = ((PyArrayObject *)range)->itemsize;\n\ttype = ((PyArrayObject *)range)->descr->type_num;\n\tfor (i=0; i < length; i++) {\n\t\tvalue = start + i*step;\n\t\tdbl_descr->cast[type]((char*)&value, rptr, 1, NULL, \n\t\t\t\t      (PyArrayObject *)range);\n\t\trptr += elsize;\n\t}\n    \n\treturn range;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=intp)\\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=Py_None, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tdouble start, stop, step;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0};\n\tint type_num;\n\tint deftype = PyArray_INTP;\n\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_TypecodeConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\tdeftype = PyArray_ObjectType(o_start, deftype);\n\tif (o_stop != Py_None) {\n\t\tdeftype = PyArray_ObjectType(o_stop, deftype);\n\t}\n\tif (o_step != NULL) {\n\t\tdeftype = PyArray_ObjectType(o_step, deftype);\n\t}\n\n\ttype_num = typecode.type_num;\n\tif (type_num == PyArray_NOTYPE) {\n\t\ttype_num = deftype;\n\t}\n\n\tstart = PyFloat_AsDouble(o_start);\n\tif error_converting(start) return NULL;\n\n\tif (o_step == NULL) {\n\t\tstep = 1;\n\t}\n\telse {\n\t\tstep = PyFloat_AsDouble(o_step);\n\t\tif error_converting(step) return NULL;\n\t}\n\n\tif (o_stop == Py_None) {\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\telse {\n\t\tstop = PyFloat_AsDouble(o_stop);\n\t\tif error_converting(stop) return NULL;\n\t}\n\n\treturn PyArray_Arange(start, stop, step, type_num);\n}\n\n#undef _ARET\n\n/*****\n      static char doc_arrayMap[] = \"arrayMap(func, [a1,...,an])\";\n\n      static PyObject *array_arrayMap(PyObject *dummy, PyObject *args) {\n      PyObject *shape, *a0;\n  \n      if (PyArg_ParseTuple(args, \"OO\", &a0, &shape) == NULL) return NULL;\n\t\n      return PyArray_Map(a0, shape);\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\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 (PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"One or more objects is not callable.\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\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\tif ((x==NULL) || (y==NULL)) {\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\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\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, n_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_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_Typecode d1={PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode d2={PyArray_NOTYPE, 0, 0};\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_TypecodeConverter, &d1,\n\t\t\t\t\tPyArray_TypecodeConverter, &d2))\n\t\treturn NULL;\n\tif (d1.type_num == PyArray_NOTYPE || \\\n\t    d2.type_num == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types. \"\\\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 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{\"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/*  {\"arrayMap\",\t(PyCFunction)array_arrayMap, \n\t    METH_VARARGS, doc_arrayMap},*/\n\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_Tyupe\",  \\\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(Numeric, Generic);\n        SINGLE_INHERIT(Integer, Numeric);\n        SINGLE_INHERIT(Inexact, Numeric);\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        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        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        SINGLE_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\t   \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, \"NOTSWAPPED\", s=PyInt_FromLong(NOTSWAPPED));\n        Py_DECREF(s);\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\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n                return; \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(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\n        set_flaginfo(d);\n\n\tif (set_typeinfo(d) == 0) \n                return;  /* otherwise there is an error */\n\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/*\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 scipy_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 <string.h>\n#include <math.h>\n*/\n\n#define _MULTIARRAYMODULE\n#include \"scipy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL;   /* Must be explicitly loaded */\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\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\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\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\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n        int i;\n        for(i=0;i<n;i++) {\n                if (l1[i] != l2[i]) return 0;\n        } \n        return 1;\n}\n\nstatic PyObject *\nPyArray_View(PyArrayObject *self, PyArray_Typecode *type)\n{\n\tPyObject *new=NULL;\n        PyObject *v=NULL;\n        int type_num = PyArray_NOTYPE;\n\n\tif (type) {\n\t\ttype_num = type->type_num;\n\t}\n\n\tnew = PyArray_New(self->ob_type,\n\t\t\t  self->nd, self->dimensions,\n\t\t\t  self->descr->type_num,\n\t\t\t  self->strides,\n\t\t\t  self->data,\n\t\t\t  self->itemsize,\n\t\t\t  self->flags, (PyObject *)self);\n\n\tif (new==NULL) return NULL;\n\t\n        Py_INCREF(self);\n        PyArray_BASE(new) = (PyObject *)self;\n        if ((type_num != PyArray_NOTYPE) &&             \\\n            (type_num != self->descr->type_num)) {\n                if (!PyTypeNum_ISFLEXIBLE(type_num)) {\n                        v = PyArray_TypeObjectFromType(type_num);\n                }\n                else {\n                        PyArray_Descr *descr;\n                        int itemsize = type->itemsize;\n                        descr = PyArray_DescrFromType(type_num);\n                        if (type_num == PyArray_UNICODE) \n                                itemsize /= sizeof(Py_UNICODE);\n                        /* construct a string representation */\n                        v = PyString_FromFormat(\"%c%d\", descr->type, \n                                                itemsize);\n                }\n                if (v == NULL) goto fail;\n                /* set attribute new.dtype = newtype */\n                if (PyObject_SetAttrString(new, \"dtype\", v) < 0) goto fail;\n                Py_DECREF(v);\n        }\n\treturn new;\t\n\n fail:\n        Py_XDECREF(v);\n        Py_XDECREF(new);\n        return NULL;\n}\n\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n        if (a->nd == 1) {\n                Py_INCREF(a);\n                return (PyObject *)a;\n        }\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) \n\t\treturn PyArray_Newshape(a, &newdim);\n\telse\n\t        return PyArray_Flatten(a, fortran);\n}\n\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tsize = PyArray_SIZE(a);\n\tret = PyArray_New(a->ob_type,\n\t\t\t  1, &size,\n\t\t\t  a->descr->type_num,\n\t\t\t  NULL,\n                          NULL,\n\t\t\t  a->itemsize,\n\t\t\t  0, (PyObject *)a);\n\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\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\n/* Returns a new array \n   with the a new shape from the data\n   in the old array\n*/\n\nstatic PyObject * \nPyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims)\n{\n        intp i, s_original, i_unknown, s_known;\n        intp *dimensions = newdims->ptr;\n        PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n        Bool same;\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<n) {\n                        if (PyArray_DIM(self,i) != dimensions[i]) \n                                same=FALSE;\n                        i++;\n                }\n                if (same) return PyArray_View(self, NULL);\n        }\n\n        if (!PyArray_ISCONTIGUOUS(self)) {\n                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"changing shape only works on contiguous arrays\");\n                return NULL;\n        }\n\t\n        s_known = 1;\n        i_unknown = -1;\n\n        for(i=0; i<n; i++) {\n                if (dimensions[i] < 0) {\n                        if (i_unknown == -1) {\n                                i_unknown = i;\n                        } else {\n                                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"can only specify one \"\t\\\n\t\t\t\t\t\t\" unknown dimension\");\n                                goto fail;\n                        }\n                } else {\n\t\t\ts_known *= dimensions[i];\n                }\n        }\n\t\n        s_original = PyArray_SIZE(self);\n\t\n        if (i_unknown >= 0) {\n                if ((s_known == 0) || (s_original % s_known != 0)) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n                dimensions[i_unknown] = s_original/s_known;\n        } else {\n                if (s_original != s_known) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n        }\n        \n\tret = (PyAO *)PyArray_New(self->ob_type,\n\t\t\t\t  n, dimensions,\n\t\t\t\t  self->descr->type_num,\n\t\t\t\t  NULL,\n\t\t\t\t  self->data,\n\t\t\t\t  self->itemsize,\n\t\t\t\t  self->flags, (PyObject *)self);\n\n\tif (ret== NULL)\n                goto fail;\n\t\n        Py_INCREF(self);\n        ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n        return (PyObject *)ret;\n\t\n fail:\n        return NULL;\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\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; i<nd; i++) {\n\t\tif (self->dimensions[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\tret = PyArray_New(self->ob_type, newnd, dimensions, \n\t\t\t  self->descr->type_num, strides,\n\t\t\t  self->data, self->itemsize, self->flags,\n\t\t\t  (PyObject *)self);\n\tself->flags &= ~OWN_DATA;\n\tself->base = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\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\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype)\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; i<n; i++) {\n\t\tif (i==axis) val = 1;\n\t\telse val = PyArray_DIM(new,i);\n\t\tPyTuple_SET_ITEM(newshape, i, PyInt_FromLong((long)val));\n\t}\n\tobj2 = PyArray_Reshape((PyAO *)obj1, newshape);\n\tPy_DECREF(obj1);\n\tPy_DECREF(newshape);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x = x - mx */\n\tobj1 = PyNumber_Subtract((PyObject *)self, obj2);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x * x */\n\tobj2 = PyNumber_Multiply(obj1, obj1);\n\tPy_DECREF(obj1);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute add.reduce(x*x,axis) */\n\tobj1 = PyArray_GenericReduceFunction((PyArrayObject *)obj2, n_ops.add,\n\t\t\t\t\t     axis, rtype);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\tn = PyArray_DIM(new,axis)-1;\n\tPy_DECREF(new);\n\tif (n==0) n=1;\n\tobj2 = PyFloat_FromDouble(1.0/((double )n));\n\tif (obj2 == NULL) {Py_DECREF(obj1); return NULL;}\n\tret = PyArray_EnsureArray(PyNumber_Multiply(obj1, obj2));\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\n\t/* sqrt() */\n\tobj1 = PyArray_GenericUnaryFunction((PyAO *)ret, n_ops.sqrt);\n\tPy_DECREF(ret);\n\n\treturn obj1;\n}\n\n\nstatic PyObject *\nPyArray_Sum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis, \n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Prod(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.multiply, axis,\n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumSum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumProd(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, \n\t\t\t\t\t\tn_ops.multiply, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Any(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_or, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_All(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_and, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Compress(PyArrayObject *self, PyObject *condition, int axis)\n{\n        PyArrayObject *cond;\n\tPyObject *res, *ret;\n\n        cond = (PyAO *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n        if (cond == NULL) return NULL;\n        \n        if (cond->nd != 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\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; i<size; i++) {\n\t\tif (self->descr->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; i<size; i++) {\n\t\t\tif (self->descr->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; j<n; j++) {\n\t\t\titem = PyArray_New(self->ob_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\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tif (item == NULL) goto fail;\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; i<size; i++) {\n\t\t\tif (self->descr->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; j<n; j++) \n\t\t\t\t\t*(dptr[j])++ = it->coordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n        \n}\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)) goto fail;\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) goto fail;\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(res1);\n\tPy_XDECREF(res2);\n\tPy_XDECREF(two);\n\tPy_XDECREF(selector);\n\treturn NULL;\n}\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_Copy(self);\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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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\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\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyObject *newaxes;\n\tint i, pos;\t\n\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 = PyTuple_New(n);\n\tif (newaxes==NULL) return NULL;\n\t/* insert at the end */\n\tPyTuple_SET_ITEM(newaxes, n-2, PyInt_FromLong((long)axis1));\n\tPyTuple_SET_ITEM(newaxes, n-1, PyInt_FromLong((long)axis2));\n\tpos = 0;\n\tfor (i=0; i<n; i++) {\n\t\tif ((i==axis1) || (i==axis2)) continue;\n\t\tPyTuple_SET_ITEM(newaxes, pos++, \n\t\t\t\t PyInt_FromLong((long) i));\n\t}\n\tnew = PyArray_Transpose(self, newaxes);\n\tPy_DECREF(newaxes);\n\tif (new == NULL) return NULL;\n\tself = (PyAO *)new;\n\t\n\tif (n == 2) {\n\t\tPyObject *a=NULL, *indices=NULL, *ret=NULL;\n\t\tintp n1, n2, start, stop, step, count;\n\t\tintp *dptr;\n\t\tn1 = self->dimensions[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; n1<stop; n1+=step) *dptr++ = n1;\n\t\ta = PyArray_IterNew((PyObject *)self);\n\t\tPy_DECREF(self);\n\t\tif (a == NULL) {Py_DECREF(indices); return NULL;}\n\t\tret = PyObject_GetItem(a, indices);\n\t\tPy_DECREF(a);\n\t\tPy_DECREF(indices);\n\t\treturn ret;\n\t}\t\n\n\telse {\n\t\t/* \n\t\t   my_diagonal = []\n\t\t   for i in range (s [0]) :\n\t\t       my_diagonal.append (diagonal (a [i], offset))\n\t\t   return array (my_diagonal)\t\n\t\t*/\t\n\t\tPyObject *mydiagonal=NULL, *new=NULL, *ret=NULL, *sel=NULL;\n\t\tintp i, n1;\n\t\tint res;\n\t\tPyArray_Typecode typecode;\n\n\t\ttypecode.type_num = self->descr->type_num;\n\t\ttypecode.itemsize = self->itemsize;\n\t\ttypecode.fortran = 0;\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<n1; i++) {\n\t\t\tnew = PyInt_FromLong((long) i);\n\t\t\tsel = PyArray_EnsureArray(PyObject_GetItem((PyObject *)self, new));\n\t\t\tPy_DECREF(new);\n\t\t\tif (sel == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnew = PyArray_Diagonal((PyAO *)sel, offset, n-3, n-2);\n\t\t\tPy_DECREF(sel);\n\t\t\tif (new == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tres = PyList_Append(mydiagonal, new);\n\t\t\tPy_DECREF(new);\n\t\t\tif (res < 0) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(self);\n\t\tret =  PyArray_FromAny(mydiagonal, &typecode, 0, 0, 0);\n\t\tPy_DECREF(mydiagonal);\n\t\treturn ret;\n\t}\n}\n\n\n\n\n\n\n/* simulates a C-style 1-3 dimensional array which can be accesed using \n    ptr[i]  or ptr[i][j] or ptr[i][j][k] -- requires pointer allocation \n    for 2-d and 3-d.\n\n    Especially for 2-d and up, ptr is NOT equivalent to a statically defined\n    2-d or 3-d array.  In particular, it cannot be passed into a \n    function that requires a true pointer to a fixed-size array. \n*/\n\nstatic int\nPyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, int type_num) \n{\n\tPyArrayObject *ap;\n\tPyArray_Typecode typecode = {0, 0, 0};\n\tintp n, m, i, j;\n\tchar **ptr2;\n\tchar ***ptr3;\n\n\ttypecode.type_num = type_num;\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot treat flexible type as C array.\");\n\t\treturn -1;\n\t}\n\tif ((nd < 1) || (nd > 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"Only Carrays of 1-3 dimensions available.\");\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, &typecode, 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 **)malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr2[i] = ap->data + 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 ***)malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr3[i] = ptr3[n + (m-1)*i];\n\t\t\tfor (j=0; j<m; j++) {\n\t\t\t\tptr3[i][j] = ap->data + 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\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, typecode) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, typecode) == -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\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\tfree(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<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\tarr = PyArray_FROM_O(otmp);\n\t\tPy_DECREF(otmp);\n\t\tif (arr==NULL) goto fail;\n\t\totmp = PyArray_SwapAxes((PyArrayObject *)arr, axis, 0);\n\t\tPy_DECREF(arr);\n\t\tif (otmp == NULL) goto fail;\n\t\tPyTuple_SET_ITEM(newtup, i, otmp);\n\t}\n\totmp = PyArray_Concatenate(newtup, 0);\n\tPy_DECREF(newtup);\n\tif (otmp == NULL) return NULL;\n\tarr = PyArray_SwapAxes((PyArrayObject *)otmp, axis, 0);\n\tPy_DECREF(otmp);\n\treturn arr;\n\t\n fail:\n\tPy_DECREF(newtup);\n\treturn NULL;\n}\n\n/*op is a python object supporting the sequence interface.\n  Its elements will be concatenated together to form a single \n  multidimensional array.*/\n/* If axis is MAX_DIMS or bigger, then each sequence object will \n   be flattened before concatenation \n*/\nstatic PyObject *\nPyArray_Concatenate(PyObject *op, int axis) \n{\n\tPyArrayObject *ret, **mps;\n\tPyObject *otmp;\n\tint i, n, type_num, tmp, nd=0, new_dim;\n\tchar *data;\t\n\tPyTypeObject *subtype;\n\tdouble prior1, prior2;\n\tintp numbytes;\n\n\tn = PySequence_Length(op);\n\tif (n == -1) {\n\t\treturn NULL;\n\t}\n\tif (n == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Concatenation of zero-length sequences is \"\\\n\t\t\t\t\"impossible.\");\n\t\treturn NULL;\n\t}\n\n\tif ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS)))\n\t\treturn _swap_and_concat(op, axis, n);\n\t\n\tret = NULL;\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\t/* Make sure these arrays are legal to concatenate. */\n\t/* Must have same dimensions except d0, and have coercible type. */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays \"\\\n\t\t\t\t\"to concatenate\");\n\t\tgoto fail;\n\t}\n\n\tprior1 = 0.0;\n\tsubtype = &PyArray_Type;\n\tret = NULL;\n\tfor(i=0; i<n; i++) {\n\t\tPyArray_Typecode typecode = {0, 0, 0};\n\t\ttypecode.type_num = type_num;\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) goto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_FromAny(otmp, &typecode, 0, 0, CARRAY_FLAGS);\n\t\tPy_DECREF(otmp);\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (axis >= 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; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (i == 0) nd = mps[i]->nd;\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\"0d 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\tret = (PyArrayObject *)PyArray_New(subtype, nd,\n\t\t\t\t\t   mps[0]->dimensions, \n\t\t\t\t\t   type_num, NULL, NULL, 0, 0,\n                                           (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; i<n; i++) {\n\t\tnumbytes = PyArray_NBYTES(mps[i]);\n\t\tmemcpy(data, mps[i]->data, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)\n{\n\tPyObject *new_axes;\n\tint n, i, val;\n\tPyObject *ret;\n\n\tif (a1 == a2) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\t\n\tn = ap->nd;\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 = PyTuple_New(n);\n\tfor (i=0; i<n; i++) {\n\t\tif (i == a1) val = a2;\n\t\telse if (i == a2) val = a1;\n\t\telse val = i;\n\t\tPyTuple_SET_ITEM(new_axes, i, PyInt_FromLong((long) val));\n\t}\n\tret = PyArray_Transpose(ap, new_axes);\n\tPy_DECREF(new_axes);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Transpose(PyArrayObject *ap, PyObject *op) {\n\tintp *axes, axis;\n\tintp i, n;\n\tintp *permutation = NULL;\n\tPyArrayObject *ret = NULL;\n\t\n\tif (op == Py_None || op == NULL) {\n\t\tn = ap->nd;\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\tfor(i=0; i<n; i++)\n\t\t\tpermutation[i] = n-1-i;\n\t} else {\n\t\tif (PyArray_AsCArray(&op, (char **)&axes, &n, 1,\n\t\t\t\t PyArray_INTP) == -1)\n\t\t\treturn NULL;\n\t\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\n\t\tfor(i=0; i<n; i++) {\n\t\t\taxis = axes[i];\n\t\t\tif (axis < 0) axis = ap->nd+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\tgoto fail;\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\tret = (PyArrayObject *)PyArray_New(ap->ob_type, n, permutation, \n\t\t\t\t\t   ap->descr->type_num, NULL,\n\t\t\t\t\t   ap->data, ap->itemsize, ap->flags,\n\t\t\t\t\t   (PyObject *)ap);\n\tif (ret == NULL) goto fail;\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; i<n; i++) {\n\t\tret->dimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n\tif (op && (op != Py_None))\n\t\tPyArray_Free(op, (char *)axes);\n\tfree(permutation);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tif (permutation != NULL) free(permutation);\n\tif (op != Py_None)\n\t\tPyArray_Free(op, (char *)axes);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\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_ContiguousFromObject(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; j<n; j++) {\n\t\t\tif (counts[j] < 0) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \"count < 0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\ttotal += counts[j];\n\t\t}\n\t}\n\n\n\t/* Construct new array */\n\taop->dimensions[axis] = total;\n\tret = (PyArrayObject *)PyArray_New(aop->ob_type, aop->nd,\n\t\t\t\t\t   aop->dimensions, \n\t\t\t\t\t   aop->descr->type_num,\n\t\t\t\t\t   NULL, NULL, aop->itemsize, 0,\n\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->itemsize;\n\tfor(i=axis+1; i<aop->nd; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; i<axis; i++) n_outer *= aop->dimensions[i];\n\n\tfor(i=0; i<n_outer; i++) {\n\t\tfor(j=0; j<n; j++) {\n\t\t\ttmp = (nd ? counts[j] : counts[0]);\n\t\t\tfor(k=0; k<tmp; k++) {\n\t\t\t\tmemcpy(new_data, old_data, chunk);\n\t\t\t\tnew_data += chunk;\n\t\t\t}\n\t\t\told_data += chunk;\n\t\t}\n\t}\n\n\tPy_DECREF(repeats);\n\tPyArray_INCREF(ret);\n\tPy_XDECREF(aop);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_DECREF(repeats);\n\tPy_XDECREF(aop);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\nstatic PyObject *\nPyArray_Choose(PyArrayObject *ip, PyObject *op) {\n\tintp i, n, *sizes, m, offset, elsize, type_num;\n\tchar *ret_data;\n\tPyArrayObject **mps, *ap, *ret;\n\tPyObject *otmp;\n\tintp *self_data, mi;\n\tap = NULL;\n\tret = NULL;\n\t\n\tn = PySequence_Length(op);\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\tsizes = (intp *)malloc(n*sizeof(intp));\n\t\n\t/* Figure out the right type for the new array */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays to \"\\\n\t\t\t\t\"choose from\");\n\t\tgoto fail;\n\t}\n\t\n\t/* Make sure all arrays are actual array objects. */\n\tfor(i=0; i<n; i++) {\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n\t\t\tgoto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_ContiguousFromObject(otmp, type_num, \n\t\t\t\t\t\t     0, 0);\n\t\tPy_DECREF(otmp);\n\t}\n\t\n\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)ip, \n\t\t\t\t\t\t\t   PyArray_INTP, \n\t\t\t\t\t\t\t   0, 0);\n\tif (ap == NULL) goto fail;\n\t\n\t/* Check the dimensions of the arrays */\n\tfor(i=0; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (ap->nd < 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\t/* why not ??? \n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Not implemented for flexible sizes\");\n\t\treturn NULL;\n\t}\n\t*/\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->itemsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i<m; i++) {\n\t\tmi = *self_data;\n\t\tif (mi < 0 || mi >= 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; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_DECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\n\treturn (PyObject *)ret;\n\t\n fail:\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_XDECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\tPy_XDECREF(ret);\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->compare(a,b,global_obj);\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#define SWAPBACK(op, ap) { \\\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\nstatic PyObject *\nPyArray_Sort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tif ((ap = (PyAO*) _check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_CopyFromObject((PyObject *)op, \n\t\t\t\t\t\t     PyArray_NOTYPE,\n\t\t\t\t\t\t     1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\n\tif (ap->descr->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\n\t}\n\t\n\telsize = ap->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\tqsort(ip, m, elsize, qsortCompare);\n\t}\n\t\n\tglobal_obj = store_arr;\n\t\t\n\tif (PyErr_Occurred()) {\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\t\n\t}\n\n finish:\n\tSWAPBACK(op, ap);\n\n\treturn (PyObject *)op;\n}\n\n\nstatic char *global_data;\n\nstatic int \nargsort_static_compare(const void *ip1, const void *ip2) \n{\n\tint isize = global_obj->itemsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->compare(global_data + (isize * *ipa),\n                                          global_data + (isize * *ipb), \n\t\t\t\t\t  global_obj);\n}\n\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap, *ret, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tif ((ap = (PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op, \n\t\t\t\t\t\t\t   PyArray_NOTYPE,\n\t\t\t\t\t\t\t   1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, PyArray_INTP,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\tif (ap->descr->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\tip = (intp *)ret->data;\n\targsort_elsize = ap->itemsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\tstore_ptr = global_data;\n\tglobal_data = ap->data;\n\tstore = global_obj;\n\tglobal_obj = ap;\n\tfor (i=0; i<n; i++, ip+=m, global_data += m*argsort_elsize) {\n\t\tfor(j=0; j<m; j++) ip[j] = j;\n\t\tqsort((char *)ip, m, sizeof(intp),\n\t\t      argsort_static_compare);\n\t}\n\tglobal_data = store_ptr;\n\tglobal_obj = store;\n\n\n finish:\n\tPy_DECREF(ap);\n\tSWAPBACK(op, ret);\n\treturn (PyObject *)op;\n\n fail:\n\tPy_XDECREF(ap);\n\tPy_XDECREF(ret);\n\treturn NULL;\n\n}  \n\nstatic void \nlocal_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret)\n{\t\n\tPyArray_CompareFunc *compare = ap2->descr->compare;\n\tintp  min_i, max_i, i, j;\n\tint location, elsize = ap1->itemsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_Size((PyObject *)ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j<n; j++, ip+=elsize, rp++) {\n\t\tmin_i = 0;\n\t\tmax_i = elements;\n\t\twhile (min_i != max_i) {\n\t\t\ti = (max_i-min_i)/2 + min_i;\n\t\t\tlocation = compare(ip, vp+elsize*i, ap2);\n\t\t\tif (location == 0) {\n\t\t\t\twhile (i > 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\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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_ContiguousFromObject((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_ContiguousFromObject(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->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\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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->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->itemsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2*l;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1*l;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\t\t\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/* just like inner product but does the swapaxes stuff on the fly */\nstatic PyObject *\nPyArray_MatrixProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tintp matchDim, otherDim, is2r, is1r;\n\tPyTypeObject *subtype;\n        double prior1, prior2;\n        \n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\t\n\t\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(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\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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<j; i++) \n\t   fprintf(stderr, \"%d \", dimensions[i]);\n\t   fprintf(stderr, \"\\n\"); \n\t*/\n\n        /* Choose which subtype to return */\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->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->itemsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2r;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1r;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\n\t\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\nstatic PyObject *\nPyArray_CopyAndTranspose(PyObject *op) \n{\n\tPyObject *ret, *arr;\n\tint nd;\n\tintp dims[2];\n\tintp i,j;\n\tint elsize, str2;\n\tchar *iptr;\n\tchar *optr;\n\n\t/* make sure it is well-behaved */\n\tarr = PyArray_FromAny(op, NULL, 0, 0, CARRAY_FLAGS);\n\tnd = PyArray_NDIM(arr);\n\tif (nd == 1) {     /* we will give in to old behavior */\n\t\tret = PyArray_Copy((PyArrayObject *)arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\t\t\n\t}\n\telse if (nd != 2) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Only 2-d arrays are allowed.\");\n\t\treturn NULL;\n\t}\n\n\t/* Now construct output array */\n\tdims[0] = PyArray_DIM(arr,1);\n\tdims[1] = PyArray_DIM(arr,0);\n\telsize = PyArray_ITEMSIZE(arr);\n\n\tret = PyArray_New(arr->ob_type, 2, dims, PyArray_TYPE(arr),\n\t\t\t  NULL, NULL, elsize, 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; i<dims[0]; i++) {\n\t\tiptr = PyArray_DATA(arr) + i*elsize;\n\t\tfor (j=0; j<dims[1]; j++) {\n\t\t\t/* optr[i,j] = iptr[j,i] */\n\t\t\tmemcpy(optr, iptr, elsize);\n\t\t\toptr += elsize;\n\t\t\tiptr += str2;\n\t\t}\n\t}\n\tPy_DECREF(arr);\n\treturn ret;\n}\n \nstatic PyObject *\nPyArray_Correlate(PyObject *op1, PyObject *op2, int mode) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\n\tintp length;\n\tint i, n1, n2, n, n_left, n_right;\n\tint typenum;\n\tint is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tPyArray_DotFunc *dot;\n\t\n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\t\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum, \n\t\t\t\t\t\t\t    1, 1);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum, \n\t\t\t\t\t\t\t    1, 1);\n\tif (ap2 == NULL) goto fail;\n\t\n\tn1 = ap1->dimensions[ap1->nd-1];\n\tn2 = ap2->dimensions[ap2->nd-1];\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 = (int)(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\t\n\tret = (PyArrayObject *)PyArray_New(ap1->ob_type, 1,\n\t\t\t\t\t   &length, typenum, \n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)ap1);\n\tif (ret == NULL) goto fail;\n\n\t\n\tdot = ret->descr->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->itemsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; i<n_left; i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tn++;\n\t\tip2 -= is2;\n\t\top += os;\n\t}\n\tfor(i=0; i<(n1-n2+1); i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tfor(i=0; i<n_right; i++) {\n\t\tn--;\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tif (PyErr_Occurred()) goto fail;\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\nstatic PyObject *\nPyArray_ArgMin(PyArrayObject *ap, int axis) \n{\n\tPyObject *obj, *new, *ret;\n\n\tif (PyArray_ISFLEXIBLE(ap)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"argmax is unsupported for this type.\");\n\t\treturn NULL;\n\t}\n\telse if (PyArray_ISUNSIGNED(ap)) \n\t\tobj = PyInt_FromLong((long) -1);\n\t\n\telse if (PyArray_TYPE(ap)==PyArray_BOOL) \n\t\tobj = PyInt_FromLong((long) 1);\n\t\n\telse \n\t\tobj = PyInt_FromLong((long) 0);\n\t\n\tnew = PyNumber_Subtract(obj, (PyObject *)ap);\n\tif (new == NULL) return NULL;\n\n\tPy_DECREF(obj);\n\tret = PyArray_ArgMax((PyArrayObject *)new, axis);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Max(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.maximum, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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\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_ContiguousFromObject((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->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->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\targ_func(ip, m, rptr, ap);\n\t\trptr += 1;\n\t}\n\tPy_DECREF(ap);\n\n\tSWAPBACK(op, rp);     /* op now contains the return */\n  \n\treturn (PyObject *)op;\n\t\n fail:\n\tPy_DECREF(ap);\n\tPy_XDECREF(rp);\n\treturn NULL;\n}  \n\n\nstatic PyObject *\nPyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n        PyArrayObject *self, *indices, *ret;\n        intp nd, i, j, n, m, max_item, tmp, chunk;\n\tintp shape[MAX_DIMS];\n        char *src, *dest;\n\t\n        indices = ret = NULL;\n\tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n        if (self == NULL) return NULL;\n\t\n        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, \n\t\t\t\t\t\t\t\tPyArray_INTP, \n\t\t\t\t\t\t\t\t1, 0);\n        if (indices == NULL) goto fail;\n\t\n        n = m = chunk = 1;\n        nd = self->nd + 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        ret = (PyArrayObject *)PyArray_New(self->ob_type, nd, shape, \n\t\t\t\t\t   self->descr->type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)self);\n\t\n        if (ret == NULL) goto fail;\n\t\n        max_item = self->dimensions[axis];\n        chunk = chunk * ret->itemsize;\n        src = self->data;\n        dest = ret->data;\n\t\n        for(i=0; i<n; i++) {\n                for(j=0; j<m; j++) {\n                        tmp = ((intp *)(indices->data))[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\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0) \n{\n        PyArrayObject  *indices, *values;\n        int i, chunk, ni, max_item, nv, tmp; \n        char *src, *dest;\n\n        indices = NULL;\n        values = NULL;\n\n        if (!PyArray_Check(self)) {\n                PyErr_SetString(PyExc_ValueError, \"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->itemsize;\n\n        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, PyArray_INTP, 0, 0);\n        if (indices == NULL) goto fail;\n        ni = PyArray_SIZE(indices);\n\n        values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromObject(values0, self->descr->type_num, \n\t\t\t\t\t     0, 0);\n        if (values == NULL) goto fail;\n        nv = PyArray_SIZE(values);\n        if (nv > 0) { /* nv == 0 for a null array */\n                for(i=0; i<ni; i++) {\n                        src = values->data + 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        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\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0) \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_ValueError, \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->itemsize;\n\n        mask = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromObject(mask0, PyArray_BOOL, 0, 0);\n        if (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_ContiguousFromObject(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\t\tfor(i=0; i<ni; i++) {\n\t\t\tsrc = values->data + chunk * (i % nv);\n\t\t\ttmp = ((Bool *)(mask->data))[i];\n\t\t\tif (tmp) {\n\t\t\t\tmemmove(dest + i * chunk, src, chunk);\n\t\t\t\tif (thistype == PyArray_OBJECT)\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\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    \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\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{\n\tif (PyObject_IsTrue(object)) *val=TRUE;\n\telse *val=FALSE;\n\tif (PyErr_Occurred()) return PY_FAIL;\n\treturn PY_SUCCEED;\n}\n\n\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (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\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n        int buflen;\n\n        buf->ptr = NULL;\n        buf->flags = WRITEABLE;\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\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) goto fail;\n        return PY_SUCCEED;\n\n fail:\n\tPyDimMem_FREE(seq->ptr);\n\treturn PY_FAIL;\n}\n\n/* This function takes a Python object representing a type and converts it \n   to a C type_num and an itemsize (elements of PyArray_Typecode structure)\n   \n   Many objects can be used to represent a type.\n */\n\nstatic int\nPyArray_TypecodeConverter(PyObject *obj, PyArray_Typecode *at)\n{\n        char *type;\n        PyArray_Descr *descr;\n        int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item, *attr=NULL;\n\n\tat->itemsize = 0;\n        if (obj == Py_None) {\n                at->type_num = PyArray_NOTYPE;\n                return PY_SUCCEED;\n        }\n\n        if (PyType_Check(obj) && PyType_IsSubtype((PyTypeObject *)obj, \n                                                  &PyGenericArrType_Type)) {\n                PyArray_TypecodeFromTypeObject(obj, at);\n                return PY_SUCCEED;\n        }\n\n\n\t/* type object could be an array */\n\tif (PyArray_Check(obj)) {\n\t\tat->type_num = PyArray_TYPE(obj);\n\t\tat->itemsize = PyArray_ITEMSIZE(obj);\n\t\treturn PY_SUCCEED;\n\t}\n\n\t/* or an array scalar */\n        if (PyArray_IsScalar(obj, Generic)) {\n                PyArray_TypecodeFromScalar(obj, at);\n                return PY_SUCCEED;\n        }\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);\t\t\n\t\tif (len > 0) {\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tif (len > 1) {\n\t\t\tat->itemsize = atoi(type+1);\n\t\t\t/* When specifying length of UNICODE\n\t\t\t   the number of characters is given to match \n\t\t\t   the STRING interface.  Each character can be\n\t\t\t   more than one byte and itemsize must be\n\t\t\t   the number of bytes.\n\t\t\t*/\n\t\t\tif (check_num == PyArray_UNICODELTR ||\t\\\n\t\t\t    check_num == PyArray_UNICODE) \n\t\t\t  at->itemsize *= sizeof(Py_UNICODE);\n\n\t\t\t/* Support for generic processing */\n\t\t\telse if ((check_num != PyArray_STRINGLTR) &&\n\t\t\t\t (check_num != PyArray_VOIDLTR) &&\n\t\t\t\t (check_num != PyArray_STRING) &&\n\t\t\t\t (check_num != PyArray_VOID)) {\n\t\t\t\tcheck_num = \\\n\t\t\t\t\tPyArray_TypestrConvert(at->itemsize,\n\t\t\t\t\t\t\t       check_num);\n\t\t\t        at->itemsize = 0;\n\t\t\t\tif (check_num == PyArray_NOTYPE) goto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Arbitray object with dtypenum and itemsize attributes. */\n\telse if (PyObject_HasAttrString(obj, \"dtypenum\") && \n\t    PyObject_HasAttrString(obj, \"itemsize\")) {\n\t\tattr = PyObject_GetAttrString(obj, \"dtypenum\");\n\t\tcheck_num = PyInt_AsLong(attr);\n\t\tif (PyErr_Occurred()) {  /* not an integer, try character */\n\t\t\tPyErr_Clear();\n\t\t\ttype = PyString_AsString(attr);\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tif (!PyErr_Occurred()) {\n\t\t\tattr = PyObject_GetAttrString(obj, \"itemsize\");\n\t\t\tat->itemsize = PyInt_AsLong(attr);\n\t\t\tPy_XDECREF(attr);\n\t\t}\t\t\t\n\t}\t\t\n\telse if (PyType_Check(obj)) {\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 *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\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                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}\t\n        else { /* Default -- try integer conversion */\n                check_num = PyInt_AsLong(obj);\n\t}\n\n\tif (PyErr_Occurred()) goto fail;\n\n\t/*\n\tif (check_num == PyArray_NOTYPE) return PY_FAIL;\n\t*/\n\tif (check_num == PyArray_NOTYPE) {\n\t\tat->type_num = PyArray_NOTYPE;\n\t\tat->itemsize = 0;\n\t\treturn PY_SUCCEED;\n\t}\n\n        if ((descr = PyArray_DescrFromType(check_num))==NULL) {\n\t\t/* Now check to see if the object is registered\n\t\t   in typeDict */\n\t\tif (typeDict != NULL) {\n\t\t\titem = PyDict_GetItem(typeDict, obj);\n\t\t\tif (item) {\n\t\t\t\tPyArray_TypecodeFromTypeObject(obj, at);\n\t\t\t\tPyErr_Clear();\n\t\t\t\treturn PY_SUCCEED;\n\t\t\t}\n\t\t}\n                return PY_FAIL;\n\t}\n\t\n        at->type_num = descr->type_num;\n\tif (at->itemsize == 0) at->itemsize = descr->elsize;\n\t\n        return PY_SUCCEED;\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\treturn PY_FAIL;\n}\t\n\n\n/* This function returns true if the two typecodes are \n   equivalent (same basic kind and same itemsize).\n*/\n\nstatic Bool\nPyArray_EquivalentTypes(PyArray_Typecode *typ1, PyArray_Typecode *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->itemsize;\n\tregister int size2=typ2->itemsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typenum1==typenum2) return TRUE;\n\n\t/* If we are here then size1 == size2 */\n\tif (typenum1 < PyArray_FLOAT) {\n\t\tif (PyTypeNum_ISBOOL(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISBOOL(typenum2));\n\t\telse if (PyTypeNum_ISUNSIGNED(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISUNSIGNED(typenum2));\n\t\telse \n\t\t\treturn (Bool)(PyTypeNum_ISSIGNED(typenum2));\n\t}\n\telse {\n\t\tif (PyTypeNum_ISFLOAT(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISFLOAT(typenum2));\n\t\telse if (PyTypeNum_ISCOMPLEX(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISCOMPLEX(typenum2));\n\t}\n\t/* Default size1 != size2 and typenum1 != typenum2 */\n\treturn FALSE;\t\n}\n\nstatic Bool \nPyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n{\n        PyArray_Typecode type1={0,0,0};\n        PyArray_Typecode type2={0,0,0};\n\n\ttype1.type_num = PyArray_TYPE(a1);\n\ttype2.type_num = PyArray_TYPE(a2);\n\ttype1.itemsize = PyArray_ITEMSIZE(a1);\n\ttype2.itemsize = PyArray_ITEMSIZE(a2);\n\t\t\t\n        return PyArray_EquivalentTypes(&type1, &type2);\n}\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_Typecode type = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n\tint type_num;\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_TypecodeConverter,\n                                        &type, \n\t\t\t\t\tPyArray_BoolConverter, &copy, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n                                        PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\ttype_num = type.type_num;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\\n            (copy==0) &&                                             \\\n\t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n\t\tif (type_num == PyArray_NOTYPE) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t\t/* One more chance */\n\t\toldtype.type_num = PyArray_TYPE(op);\n\t\toldtype.itemsize = PyArray_ITEMSIZE(op);\n\t\tif (PyArray_EquivalentTypes(&oldtype, &type)) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t}\n\n\ttype.fortran = fortran; \n\tif (copy) {\n\t\tflags = ENSURECOPY;\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\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n        \n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Empty(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypestr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. typestr must be a valid data typestr (complete with < > or |).  If dtypestr is object, 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[] = {\"dtypestr\",\"obj\", NULL};\n\tPyArray_Typecode typecode;\n\tPyObject *obj=NULL;\n\tchar *typestr;\n\tint typestrlen;\n\tint swap, alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"z#|O\",\n\t\t\t\t\t kwlist, &typestr, &typestrlen,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\n\tif (_array_typecode_fromstr(typestr, &swap, &typecode) < 0) \n\t\treturn NULL;\n\t\n\tif (typecode.itemsize == 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\tswap = 0;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = malloc(typecode.itemsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode.itemsize);\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_ValueError, \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.itemsize) {\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.type_num,\n\t\t\t     typecode.itemsize, swap); \n\n\t/* free dptr which contains zeros */\n\tif (alloc) free(dptr);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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 {\t\t\n\t\tmemset(ret->data, 0, n*(ret->itemsize));\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Zeros(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return 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\nstatic char doc_fromString[] = \"fromstring(string, dtype=intp, count=-1, swap=False) 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\tPyArrayObject *ret; \n\tchar *data;\n\tlonglong nin=-1;\n\tintp s, n;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", \"swap\",NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint itemsize;\n\tint swapped=FALSE;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&LO&\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &swapped)) {\n\t\treturn NULL;\n\t}\n\t\n\tn = (intp) nin;\n\n\titemsize = type.itemsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize.\");\n\t\treturn NULL;\n\t}\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\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\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\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype.type_num, NULL, \n\t\t\t\t\t\tNULL, itemsize, 0,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*ret->itemsize);\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPyArray_INCREF(ret);\n\treturn (PyObject *)ret;\n}\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\nstatic int\n_fill_in_itemsize(PyArray_Typecode *typecode)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(typecode->type_num);\n\tif (descr==NULL) return -1;\n\ttypecode->itemsize = descr->elsize;\n\treturn 0;\n}\n\n\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Typecode *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\n\tif (typecode->itemsize == 0) {\n\t\tif (_fill_in_itemsize(typecode) < 0) \n\t\t\treturn NULL;\n\t}\n\n\tif (num == -1 && sep == NULL) {  /* 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\tfseek(fp, (long) start, SEEK_SET);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \"Could not seek in file.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif (typecode->itemsize == 0) {\n\t\t\ttypecode->itemsize = numbytes;\n\t\t\tnum = 1;\n\t\t}\n\t\telse {\n\t\t\tnum = numbytes / typecode->itemsize;\n\t\t}\n\t}\n\t\n\tif (sep==NULL) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &num, \n\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t typecode->itemsize, 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->itemsize, 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 = PyArray_DescrFromType(typecode->type_num)->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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &num, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\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, r->itemsize, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->itemsize;\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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &size, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->itemsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, r->itemsize, 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->itemsize;\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->itemsize);\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->itemsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=intp, count=-1, sep='')\\n\"\\\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_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\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, \"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\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Typecode *type, \n\t\t   intp count, int swapped) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\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\treturn NULL;\n\t}\n\tif (type->itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Itemsize cannot be zero in type\");\n\t\treturn NULL;\n\t}\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\treturn NULL;\n\t\t}\n\t}\n\ts = (intp)ts;\t\n\tn = (intp)count;\n\titemsize = type->itemsize;\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\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\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype->type_num, NULL, \n\t\t\t\t\t\tdata, itemsize, DEFAULT_FLAGS,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPy_INCREF(buf);\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret; \t\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=intp, count=-1, swap=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 the buffer has data that is out\\n\" \\\n\t\"   not in machine byte-order, than set swap=1.  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;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", \n\t\t\t\t \"swap\", NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint swapped=0;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Li\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &swapped)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromBuffer(obj, &type, (intp)nin, swapped);\n}\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\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length, i;\n\tPyObject *range;\n\tchar *rptr;\n\tint elsize, type;\n\tdouble value;\n\tPyArray_Descr *dbl_descr;\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\tdbl_descr = PyArray_DescrFromType(PyArray_DOUBLE);\n    \n\trptr = ((PyArrayObject *)range)->data;\n\telsize = ((PyArrayObject *)range)->itemsize;\n\ttype = ((PyArrayObject *)range)->descr->type_num;\n\tfor (i=0; i < length; i++) {\n\t\tvalue = start + i*step;\n\t\tdbl_descr->cast[type]((char*)&value, rptr, 1, NULL, \n\t\t\t\t      (PyArrayObject *)range);\n\t\trptr += elsize;\n\t}\n    \n\treturn range;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=intp)\\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=Py_None, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tdouble start, stop, step;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0};\n\tint type_num;\n\tint deftype = PyArray_INTP;\n\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_TypecodeConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\tdeftype = PyArray_ObjectType(o_start, deftype);\n\tif (o_stop != Py_None) {\n\t\tdeftype = PyArray_ObjectType(o_stop, deftype);\n\t}\n\tif (o_step != NULL) {\n\t\tdeftype = PyArray_ObjectType(o_step, deftype);\n\t}\n\n\ttype_num = typecode.type_num;\n\tif (type_num == PyArray_NOTYPE) {\n\t\ttype_num = deftype;\n\t}\n\n\tstart = PyFloat_AsDouble(o_start);\n\tif error_converting(start) return NULL;\n\n\tif (o_step == NULL) {\n\t\tstep = 1;\n\t}\n\telse {\n\t\tstep = PyFloat_AsDouble(o_step);\n\t\tif error_converting(step) return NULL;\n\t}\n\n\tif (o_stop == Py_None) {\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\telse {\n\t\tstop = PyFloat_AsDouble(o_stop);\n\t\tif error_converting(stop) return NULL;\n\t}\n\n\treturn PyArray_Arange(start, stop, step, type_num);\n}\n\n#undef _ARET\n\n/*****\n      static char doc_arrayMap[] = \"arrayMap(func, [a1,...,an])\";\n\n      static PyObject *array_arrayMap(PyObject *dummy, PyObject *args) {\n      PyObject *shape, *a0;\n  \n      if (PyArg_ParseTuple(args, \"OO\", &a0, &shape) == NULL) return NULL;\n\t\n      return PyArray_Map(a0, shape);\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\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 (PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"One or more objects is not callable.\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\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\tif ((x==NULL) || (y==NULL)) {\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\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\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, n_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_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_Typecode d1={PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode d2={PyArray_NOTYPE, 0, 0};\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_TypecodeConverter, &d1,\n\t\t\t\t\tPyArray_TypecodeConverter, &d2))\n\t\treturn NULL;\n\tif (d1.type_num == PyArray_NOTYPE || \\\n\t    d2.type_num == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types. \"\\\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 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{\"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/*  {\"arrayMap\",\t(PyCFunction)array_arrayMap, \n\t    METH_VARARGS, doc_arrayMap},*/\n\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_Tyupe\",  \\\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(Numeric, Generic);\n        SINGLE_INHERIT(Integer, Numeric);\n        SINGLE_INHERIT(Inexact, Numeric);\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        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        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        SINGLE_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\t   \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, \"NOTSWAPPED\", s=PyInt_FromLong(NOTSWAPPED));\n        Py_DECREF(s);\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\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n                return; \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(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\n        set_flaginfo(d);\n\n\tif (set_typeinfo(d) == 0) \n                return;  /* otherwise there is an error */\n\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": "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": 51,
                        "end_line": 56,
                        "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": 59,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 68,
                        "end_line": 80,
                        "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": 83,
                        "end_line": 90,
                        "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_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 9,
                        "token_count": 245,
                        "parameters": [
                            "self",
                            "type"
                        ],
                        "start_line": 93,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Ravel",
                        "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 87,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 144,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Flatten",
                        "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 32,
                        "complexity": 5,
                        "token_count": 162,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 161,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 202,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Newshape",
                        "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)",
                        "filename": "multiarraymodule.c",
                        "nloc": 68,
                        "complexity": 15,
                        "token_count": 366,
                        "parameters": [
                            "self",
                            "newdims"
                        ],
                        "start_line": 219,
                        "end_line": 298,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Squeeze",
                        "long_name": "PyArray_Squeeze( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 4,
                        "token_count": 192,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 306,
                        "end_line": 337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 32,
                        "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": 341,
                        "end_line": 362,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 43,
                        "complexity": 12,
                        "token_count": 433,
                        "parameters": [
                            "self",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 365,
                        "end_line": 420,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "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": 424,
                        "end_line": 434,
                        "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": 437,
                        "end_line": 447,
                        "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": 450,
                        "end_line": 460,
                        "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": 463,
                        "end_line": 474,
                        "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": 477,
                        "end_line": 488,
                        "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": 491,
                        "end_line": 502,
                        "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": 506,
                        "end_line": 526,
                        "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": 50,
                        "complexity": 13,
                        "token_count": 403,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 529,
                        "end_line": 587,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Clip",
                        "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 6,
                        "token_count": 241,
                        "parameters": [
                            "self",
                            "min",
                            "max"
                        ],
                        "start_line": 590,
                        "end_line": 623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Conjugate",
                        "long_name": "PyArray_Conjugate( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 9,
                        "token_count": 225,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 626,
                        "end_line": 662,
                        "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": 665,
                        "end_line": 675,
                        "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": 106,
                        "complexity": 24,
                        "token_count": 808,
                        "parameters": [
                            "self",
                            "offset",
                            "axis1",
                            "axis2"
                        ],
                        "start_line": 678,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_AsCArray",
                        "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , int type_num)",
                        "filename": "multiarraymodule.c",
                        "nloc": 55,
                        "complexity": 13,
                        "token_count": 432,
                        "parameters": [
                            "op",
                            "ptr",
                            "dims",
                            "nd",
                            "type_num"
                        ],
                        "start_line": 816,
                        "end_line": 872,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 57,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_As1D",
                        "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "typecode"
                        ],
                        "start_line": 877,
                        "end_line": 885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 9,
                        "complexity": 2,
                        "token_count": 81,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "d2",
                            "typecode"
                        ],
                        "start_line": 889,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 904,
                        "end_line": 915,
                        "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": 919,
                        "end_line": 947,
                        "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": 114,
                        "complexity": 24,
                        "token_count": 771,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 956,
                        "end_line": 1084,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 129,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SwapAxes",
                        "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 37,
                        "complexity": 12,
                        "token_count": 227,
                        "parameters": [
                            "ap",
                            "a1",
                            "a2"
                        ],
                        "start_line": 1087,
                        "end_line": 1126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Transpose",
                        "long_name": "PyArray_Transpose( PyArrayObject * ap , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 49,
                        "complexity": 15,
                        "token_count": 403,
                        "parameters": [
                            "ap",
                            "op"
                        ],
                        "start_line": 1130,
                        "end_line": 1189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "qsortCompare",
                        "long_name": "qsortCompare( const * a , const * b)",
                        "filename": "multiarraymodule.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 1408,
                        "end_line": 1411,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 7,
                        "token_count": 250,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1433,
                        "end_line": 1482,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "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": 63,
                        "parameters": [
                            "ip1",
                            "ip2"
                        ],
                        "start_line": 1488,
                        "end_line": 1496,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "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": 1561,
                        "end_line": 1596,
                        "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": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "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": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 101,
                        "complexity": 20,
                        "token_count": 783,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1884,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 125,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyAndTranspose",
                        "long_name": "PyArray_CopyAndTranspose( PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 44,
                        "complexity": 6,
                        "token_count": 278,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 1887,
                        "end_line": 1938,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 13,
                        "token_count": 625,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1941,
                        "end_line": 2039,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 99,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgMin",
                        "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 5,
                        "token_count": 138,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2042,
                        "end_line": 2067,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Max",
                        "long_name": "PyArray_Max( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2070,
                        "end_line": 2081,
                        "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": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2084,
                        "end_line": 2095,
                        "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": 2098,
                        "end_line": 2121,
                        "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": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2125,
                        "end_line": 2182,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2186,
                        "end_line": 2258,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2261,
                        "end_line": 2313,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2316,
                        "end_line": 2378,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 2390,
                        "end_line": 2402,
                        "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": 7,
                        "complexity": 3,
                        "token_count": 42,
                        "parameters": [
                            "object",
                            "val"
                        ],
                        "start_line": 2405,
                        "end_line": 2411,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypestrConvert",
                        "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)",
                        "filename": "multiarraymodule.c",
                        "nloc": 90,
                        "complexity": 33,
                        "token_count": 284,
                        "parameters": [
                            "itemsize",
                            "gentype"
                        ],
                        "start_line": 2415,
                        "end_line": 2524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "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": 2539,
                        "end_line": 2564,
                        "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": 35,
                        "complexity": 10,
                        "token_count": 186,
                        "parameters": [
                            "obj",
                            "seq"
                        ],
                        "start_line": 2576,
                        "end_line": 2612,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypecodeConverter",
                        "long_name": "PyArray_TypecodeConverter( PyObject * obj , PyArray_Typecode * at)",
                        "filename": "multiarraymodule.c",
                        "nloc": 108,
                        "complexity": 33,
                        "token_count": 639,
                        "parameters": [
                            "obj",
                            "at"
                        ],
                        "start_line": 2621,
                        "end_line": 2759,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 139,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivalentTypes",
                        "long_name": "PyArray_EquivalentTypes( PyArray_Typecode * typ1 , PyArray_Typecode * typ2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 24,
                        "complexity": 8,
                        "token_count": 162,
                        "parameters": [
                            "typ1",
                            "typ2"
                        ],
                        "start_line": 2767,
                        "end_line": 2794,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivArrTypes",
                        "long_name": "PyArray_EquivArrTypes( PyArrayObject * a1 , PyArrayObject * a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 80,
                        "parameters": [
                            "a1",
                            "a2"
                        ],
                        "start_line": 2797,
                        "end_line": 2808,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 282,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2830,
                        "end_line": 2881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Empty",
                        "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 99,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2884,
                        "end_line": 2900,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_empty",
                        "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2906,
                        "end_line": 2930,
                        "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": 56,
                        "complexity": 11,
                        "token_count": 290,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2935,
                        "end_line": 2999,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 65,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Zeros",
                        "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 20,
                        "complexity": 3,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 3003,
                        "end_line": 3025,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_zeros",
                        "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 22,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3031,
                        "end_line": 3055,
                        "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": 3062,
                        "end_line": 3071,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromString",
                        "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 8,
                        "token_count": 283,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3076,
                        "end_line": 3131,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fill_in_itemsize",
                        "long_name": "_fill_in_itemsize( PyArray_Typecode * typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "typecode"
                        ],
                        "start_line": 3146,
                        "end_line": 3153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromFile",
                        "long_name": "PyArray_FromFile( FILE * fp , PyArray_Typecode * typecode , intp num , char * sep)",
                        "filename": "multiarraymodule.c",
                        "nloc": 113,
                        "complexity": 23,
                        "token_count": 682,
                        "parameters": [
                            "fp",
                            "typecode",
                            "num",
                            "sep"
                        ],
                        "start_line": 3157,
                        "end_line": 3284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 128,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromfile",
                        "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 221,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3302,
                        "end_line": 3337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromBuffer",
                        "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Typecode * type , intp count , int swapped)",
                        "filename": "multiarraymodule.c",
                        "nloc": 58,
                        "complexity": 11,
                        "token_count": 306,
                        "parameters": [
                            "buf",
                            "type",
                            "count",
                            "swapped"
                        ],
                        "start_line": 3340,
                        "end_line": 3403,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frombuffer",
                        "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 16,
                        "complexity": 2,
                        "token_count": 115,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3417,
                        "end_line": 3434,
                        "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": 3441,
                        "end_line": 3452,
                        "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": 3459,
                        "end_line": 3465,
                        "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": 3472,
                        "end_line": 3478,
                        "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": 3482,
                        "end_line": 3488,
                        "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": 3492,
                        "end_line": 3501,
                        "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": 29,
                        "complexity": 4,
                        "token_count": 229,
                        "parameters": [
                            "start",
                            "stop",
                            "step",
                            "type_num"
                        ],
                        "start_line": 3505,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_arange",
                        "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 10,
                        "token_count": 258,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 3544,
                        "end_line": 3592,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 11,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3612,
                        "end_line": 3623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "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": 3,
                        "token_count": 67,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3629,
                        "end_line": 3646,
                        "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": 29,
                        "complexity": 8,
                        "token_count": 226,
                        "parameters": [
                            "condition",
                            "x",
                            "y"
                        ],
                        "start_line": 3650,
                        "end_line": 3686,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "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": 3694,
                        "end_line": 3702,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3708,
                        "end_line": 3719,
                        "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": 23,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3726,
                        "end_line": 3750,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 3810,
                        "end_line": 3919,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "set_flaginfo",
                        "long_name": "set_flaginfo( PyObject * d)",
                        "filename": "multiarraymodule.c",
                        "nloc": 23,
                        "complexity": 1,
                        "token_count": 171,
                        "parameters": [
                            "d"
                        ],
                        "start_line": 3924,
                        "end_line": 3950,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 52,
                        "complexity": 12,
                        "token_count": 361,
                        "parameters": [],
                        "start_line": 3955,
                        "end_line": 4031,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "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": 51,
                        "end_line": 56,
                        "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": 59,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 68,
                        "end_line": 80,
                        "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": 83,
                        "end_line": 90,
                        "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_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 9,
                        "token_count": 245,
                        "parameters": [
                            "self",
                            "type"
                        ],
                        "start_line": 93,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Ravel",
                        "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 87,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 144,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Flatten",
                        "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 32,
                        "complexity": 5,
                        "token_count": 162,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 161,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 202,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Newshape",
                        "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)",
                        "filename": "multiarraymodule.c",
                        "nloc": 68,
                        "complexity": 15,
                        "token_count": 366,
                        "parameters": [
                            "self",
                            "newdims"
                        ],
                        "start_line": 219,
                        "end_line": 298,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Squeeze",
                        "long_name": "PyArray_Squeeze( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 4,
                        "token_count": 192,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 306,
                        "end_line": 337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 32,
                        "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": 341,
                        "end_line": 362,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 43,
                        "complexity": 12,
                        "token_count": 433,
                        "parameters": [
                            "self",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 365,
                        "end_line": 420,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "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": 424,
                        "end_line": 434,
                        "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": 437,
                        "end_line": 447,
                        "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": 450,
                        "end_line": 460,
                        "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": 463,
                        "end_line": 474,
                        "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": 477,
                        "end_line": 488,
                        "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": 491,
                        "end_line": 502,
                        "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": 506,
                        "end_line": 526,
                        "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": 50,
                        "complexity": 13,
                        "token_count": 403,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 529,
                        "end_line": 587,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Clip",
                        "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 6,
                        "token_count": 241,
                        "parameters": [
                            "self",
                            "min",
                            "max"
                        ],
                        "start_line": 590,
                        "end_line": 623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Conjugate",
                        "long_name": "PyArray_Conjugate( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 9,
                        "token_count": 225,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 626,
                        "end_line": 662,
                        "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": 665,
                        "end_line": 675,
                        "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": 106,
                        "complexity": 24,
                        "token_count": 808,
                        "parameters": [
                            "self",
                            "offset",
                            "axis1",
                            "axis2"
                        ],
                        "start_line": 678,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_AsCArray",
                        "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , int type_num)",
                        "filename": "multiarraymodule.c",
                        "nloc": 55,
                        "complexity": 13,
                        "token_count": 432,
                        "parameters": [
                            "op",
                            "ptr",
                            "dims",
                            "nd",
                            "type_num"
                        ],
                        "start_line": 816,
                        "end_line": 872,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 57,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_As1D",
                        "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "typecode"
                        ],
                        "start_line": 877,
                        "end_line": 885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 9,
                        "complexity": 2,
                        "token_count": 81,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "d2",
                            "typecode"
                        ],
                        "start_line": 889,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 904,
                        "end_line": 915,
                        "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": 919,
                        "end_line": 947,
                        "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": 114,
                        "complexity": 24,
                        "token_count": 771,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 956,
                        "end_line": 1084,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 129,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SwapAxes",
                        "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 37,
                        "complexity": 12,
                        "token_count": 227,
                        "parameters": [
                            "ap",
                            "a1",
                            "a2"
                        ],
                        "start_line": 1087,
                        "end_line": 1126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Transpose",
                        "long_name": "PyArray_Transpose( PyArrayObject * ap , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 49,
                        "complexity": 15,
                        "token_count": 403,
                        "parameters": [
                            "ap",
                            "op"
                        ],
                        "start_line": 1130,
                        "end_line": 1189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "qsortCompare",
                        "long_name": "qsortCompare( const * a , const * b)",
                        "filename": "multiarraymodule.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 1408,
                        "end_line": 1411,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 7,
                        "token_count": 250,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1433,
                        "end_line": 1482,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "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": 63,
                        "parameters": [
                            "ip1",
                            "ip2"
                        ],
                        "start_line": 1488,
                        "end_line": 1496,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "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": 1561,
                        "end_line": 1596,
                        "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": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "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": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 99,
                        "complexity": 20,
                        "token_count": 760,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1882,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyAndTranspose",
                        "long_name": "PyArray_CopyAndTranspose( PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 44,
                        "complexity": 6,
                        "token_count": 278,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 1885,
                        "end_line": 1936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 87,
                        "complexity": 13,
                        "token_count": 602,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1939,
                        "end_line": 2035,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 97,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgMin",
                        "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 5,
                        "token_count": 138,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2038,
                        "end_line": 2063,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Max",
                        "long_name": "PyArray_Max( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2066,
                        "end_line": 2077,
                        "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": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2080,
                        "end_line": 2091,
                        "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": 2094,
                        "end_line": 2117,
                        "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": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2121,
                        "end_line": 2178,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2182,
                        "end_line": 2254,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2257,
                        "end_line": 2309,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2312,
                        "end_line": 2374,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 2386,
                        "end_line": 2398,
                        "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": 7,
                        "complexity": 3,
                        "token_count": 42,
                        "parameters": [
                            "object",
                            "val"
                        ],
                        "start_line": 2401,
                        "end_line": 2407,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypestrConvert",
                        "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)",
                        "filename": "multiarraymodule.c",
                        "nloc": 90,
                        "complexity": 33,
                        "token_count": 284,
                        "parameters": [
                            "itemsize",
                            "gentype"
                        ],
                        "start_line": 2411,
                        "end_line": 2520,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "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": 2535,
                        "end_line": 2560,
                        "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": 35,
                        "complexity": 10,
                        "token_count": 186,
                        "parameters": [
                            "obj",
                            "seq"
                        ],
                        "start_line": 2572,
                        "end_line": 2608,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypecodeConverter",
                        "long_name": "PyArray_TypecodeConverter( PyObject * obj , PyArray_Typecode * at)",
                        "filename": "multiarraymodule.c",
                        "nloc": 108,
                        "complexity": 33,
                        "token_count": 639,
                        "parameters": [
                            "obj",
                            "at"
                        ],
                        "start_line": 2617,
                        "end_line": 2755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 139,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivalentTypes",
                        "long_name": "PyArray_EquivalentTypes( PyArray_Typecode * typ1 , PyArray_Typecode * typ2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 24,
                        "complexity": 8,
                        "token_count": 162,
                        "parameters": [
                            "typ1",
                            "typ2"
                        ],
                        "start_line": 2763,
                        "end_line": 2790,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivArrTypes",
                        "long_name": "PyArray_EquivArrTypes( PyArrayObject * a1 , PyArrayObject * a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 80,
                        "parameters": [
                            "a1",
                            "a2"
                        ],
                        "start_line": 2793,
                        "end_line": 2804,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 282,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2826,
                        "end_line": 2877,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Empty",
                        "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 99,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2880,
                        "end_line": 2896,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_empty",
                        "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2902,
                        "end_line": 2926,
                        "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": 56,
                        "complexity": 11,
                        "token_count": 290,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2931,
                        "end_line": 2995,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 65,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Zeros",
                        "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 20,
                        "complexity": 3,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2999,
                        "end_line": 3021,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_zeros",
                        "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 22,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3027,
                        "end_line": 3051,
                        "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": 3058,
                        "end_line": 3067,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromString",
                        "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 8,
                        "token_count": 283,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3072,
                        "end_line": 3127,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fill_in_itemsize",
                        "long_name": "_fill_in_itemsize( PyArray_Typecode * typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "typecode"
                        ],
                        "start_line": 3142,
                        "end_line": 3149,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromFile",
                        "long_name": "PyArray_FromFile( FILE * fp , PyArray_Typecode * typecode , intp num , char * sep)",
                        "filename": "multiarraymodule.c",
                        "nloc": 113,
                        "complexity": 23,
                        "token_count": 682,
                        "parameters": [
                            "fp",
                            "typecode",
                            "num",
                            "sep"
                        ],
                        "start_line": 3153,
                        "end_line": 3280,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 128,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromfile",
                        "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 221,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3298,
                        "end_line": 3333,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromBuffer",
                        "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Typecode * type , intp count , int swapped)",
                        "filename": "multiarraymodule.c",
                        "nloc": 58,
                        "complexity": 11,
                        "token_count": 306,
                        "parameters": [
                            "buf",
                            "type",
                            "count",
                            "swapped"
                        ],
                        "start_line": 3336,
                        "end_line": 3399,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frombuffer",
                        "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 16,
                        "complexity": 2,
                        "token_count": 115,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3413,
                        "end_line": 3430,
                        "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": 3437,
                        "end_line": 3448,
                        "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": 3455,
                        "end_line": 3461,
                        "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": 3468,
                        "end_line": 3474,
                        "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": 3478,
                        "end_line": 3484,
                        "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": 3488,
                        "end_line": 3497,
                        "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": 29,
                        "complexity": 4,
                        "token_count": 229,
                        "parameters": [
                            "start",
                            "stop",
                            "step",
                            "type_num"
                        ],
                        "start_line": 3501,
                        "end_line": 3534,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_arange",
                        "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 10,
                        "token_count": 258,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 3540,
                        "end_line": 3588,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 11,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3608,
                        "end_line": 3619,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "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": 3,
                        "token_count": 67,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3625,
                        "end_line": 3642,
                        "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": 29,
                        "complexity": 8,
                        "token_count": 226,
                        "parameters": [
                            "condition",
                            "x",
                            "y"
                        ],
                        "start_line": 3646,
                        "end_line": 3682,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "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": 3690,
                        "end_line": 3698,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3704,
                        "end_line": 3715,
                        "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": 23,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3722,
                        "end_line": 3746,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 3806,
                        "end_line": 3915,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "set_flaginfo",
                        "long_name": "set_flaginfo( PyObject * d)",
                        "filename": "multiarraymodule.c",
                        "nloc": 23,
                        "complexity": 1,
                        "token_count": 171,
                        "parameters": [
                            "d"
                        ],
                        "start_line": 3920,
                        "end_line": 3946,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 52,
                        "complexity": 12,
                        "token_count": 361,
                        "parameters": [],
                        "start_line": 3951,
                        "end_line": 4027,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "PyArray_ArgMax",
                        "long_name": "PyArray_ArgMax( PyArrayObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 7,
                        "token_count": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2125,
                        "end_line": 2182,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2186,
                        "end_line": 2258,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2261,
                        "end_line": 2313,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_InnerProduct",
                        "long_name": "PyArray_InnerProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgSort",
                        "long_name": "PyArray_ArgSort( PyArrayObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2316,
                        "end_line": 2378,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 13,
                        "token_count": 625,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1941,
                        "end_line": 2039,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 99,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 101,
                        "complexity": 20,
                        "token_count": 783,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1884,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 125,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SearchSorted",
                        "long_name": "PyArray_SearchSorted( PyArrayObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 33,
                        "complexity": 5,
                        "token_count": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 46,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 3123,
                "complexity": 637,
                "token_count": 20370,
                "diff_parsed": {
                    "added": [
                        "\trepeats = (PyAO *)PyArray_ContiguousFromAny(op, PyArray_INTP, 0, 1);",
                        "\t\t\tPyArray_ContiguousFromAny(otmp, type_num,",
                        "\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ip,",
                        "\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op,",
                        "\tap1 = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op1,",
                        "\tap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum,",
                        "\tap1 = (PyArrayObject *)PyArray_ContiguousFromAny(op1, typenum,",
                        "\tap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum,",
                        "\tPyArray_Typecode typec = {0,0,0};",
                        "\ttypec.type_num = typenum;",
                        "\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 0, 0,",
                        "\t\t\t\t\t       DEFAULT_FLAGS);",
                        "\tap2 = (PyArrayObject *)PyArray_FromAny(op2, &typec, 0, 0,",
                        "\t\t\t\t\t       DEFAULT_FLAGS);",
                        "\tPyArray_Typecode typec = {0,0,0};",
                        "",
                        "\ttypec.type_num = typenum;",
                        "\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,",
                        "\t\t\t\t\t       DEFAULT_FLAGS);",
                        "\tap2 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,",
                        "\t\t\t\t\t       DEFAULT_FLAGS);",
                        "\t\tPyArray_ContiguousFromAny((PyObject *)op,",
                        "\t\t\t\t\t  PyArray_NOTYPE, 1, 0);",
                        "        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0,",
                        "        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);",
                        "\t\tPyArray_ContiguousFromAny(values0, self->descr->type_num,",
                        "\t\tPyArray_ContiguousFromAny(mask0, PyArray_BOOL, 0, 0);",
                        "\t\tPyArray_ContiguousFromAny(values0, thistype, 0, 0);"
                    ],
                    "deleted": [
                        "\trepeats = (PyAO *)PyArray_ContiguousFromObject(op, PyArray_INTP, 0, 1);",
                        "\t\t\tPyArray_ContiguousFromObject(otmp, type_num,",
                        "\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)ip,",
                        "\tap = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op,",
                        "\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)op1,",
                        "\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum,",
                        "\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum,",
                        "\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum,",
                        "\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum,",
                        "\t\t\t\t\t\t\t    0, 0);",
                        "\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum,",
                        "\t\t\t\t\t\t\t    0, 0);",
                        "",
                        "\tap1 = (PyArrayObject *)PyArray_ContiguousFromObject(op1, typenum,",
                        "\t\t\t\t\t\t\t    1, 1);",
                        "\tap2 = (PyArrayObject *)PyArray_ContiguousFromObject(op2, typenum,",
                        "\t\t\t\t\t\t\t    1, 1);",
                        "\t\tPyArray_ContiguousFromObject((PyObject *)op,",
                        "\t\t\t\t\t     PyArray_NOTYPE, 1, 0);",
                        "        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0,",
                        "        indices = (PyArrayObject *)PyArray_ContiguousFromObject(indices0, PyArray_INTP, 0, 0);",
                        "\t\tPyArray_ContiguousFromObject(values0, self->descr->type_num,",
                        "\t\tPyArray_ContiguousFromObject(mask0, PyArray_BOOL, 0, 0);",
                        "\t\tPyArray_ContiguousFromObject(values0, thistype, 0, 0);"
                    ]
                }
            },
            {
                "old_path": "scipy/basic/basic_lite.py",
                "new_path": "scipy/basic/basic_lite.py",
                "filename": "basic_lite.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -411,8 +411,8 @@ def linear_least_squares(a, b, rcond=1.e-10):\n otherwise resids = sum((b-dot(A,x)**2).\n Singular values less than s[0]*rcond are treated as zero.\n \"\"\"\n-    a = asndarray(a)\n-    b = asndarary(b)\n+    a = asarray(a)\n+    b = asarray(b)\n     one_eq = len(b.shape) == 1\n     if one_eq:\n         b = b[:, Numeric.NewAxis]\n",
                "added_lines": 2,
                "deleted_lines": 2,
                "source_code": "# This module is a lite version of LinAlg.py module which contains\n# high-level Python interface to the LAPACK library.  The lite version\n# only accesses the following LAPACK functions: dgesv, zgesv, dgeev,\n# zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf, dpotrf.\n\nimport scipy.base as Numeric\nimport scipy.lib.lapack_lite as lapack_lite\nMLab = Numeric\nfrom scipy.base import asarray, multiply\nimport math\n\n# Error object\nclass LinAlgError(Exception):\n    pass\n\n# Helper routines\n_lapack_type = {'f': 0, 'd': 1, 'F': 2, 'D': 3}\n_lapack_letter = ['s', 'd', 'c', 'z']\n_array_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\n_array_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\n_array_type = [['f', 'd'], ['F', 'D']]\n\ndef _commonType(*arrays):\n    kind = 0\n#    precision = 0\n#   force higher precision in lite version\n    precision = 1\n    for a in arrays:\n        t = a.dtypechar\n        kind = max(kind, _array_kind[t])\n        precision = max(precision, _array_precision[t])\n    return _array_type[kind][precision]\n\ndef _castCopyAndTranspose(type, *arrays):\n    cast_arrays = ()\n    for a in arrays:\n        cast_arrays = cast_arrays + (Numeric.transpose(a).astype(type),)\n    if len(cast_arrays) == 1:\n            return cast_arrays[0]\n    else:\n        return cast_arrays\n\n# _fastCopyAndTranpose is an optimized version of _castCopyAndTranspose.\n# It assumes the input is 2D (as all the calls in here are).\n\n_fastCT = Numeric.fastCopyAndTranspose\n\ndef _fastCopyAndTranspose(type, *arrays):\n    cast_arrays = ()\n    for a in arrays:\n        if a.dtypechar == type:\n            cast_arrays = cast_arrays + (_fastCT(a),)\n        else:\n            cast_arrays = cast_arrays + (_fastCT(a.astype(type)),)\n    if len(cast_arrays) == 1:\n            return cast_arrays[0]\n    else:\n        return cast_arrays\n\ndef _assertRank2(*arrays):\n    for a in arrays:\n        if len(a.shape) != 2:\n            raise LinAlgError, 'Array must be two-dimensional'\n\ndef _assertSquareness(*arrays):\n    for a in arrays:\n        if max(a.shape) != min(a.shape):\n            raise LinAlgError, 'Array must be square'\n\n\n# Linear equations\n\ndef solve_linear_equations(a, b):\n    one_eq = len(b.shape) == 1\n    if one_eq:\n        b = b[:, Numeric.NewAxis]\n    _assertRank2(a, b)\n    _assertSquareness(a)\n    n_eq = a.shape[0]\n    n_rhs = b.shape[1]\n    if n_eq != b.shape[0]:\n        raise LinAlgError, 'Incompatible dimensions'\n    t =_commonType(a, b)\n#    lapack_routine = _findLapackRoutine('gesv', t)\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgesv\n    else:\n        lapack_routine = lapack_lite.dgesv\n    a, b = _fastCopyAndTranspose(t, a, b)\n    pivots = Numeric.zeros(n_eq, 'i')\n    results = lapack_routine(n_eq, n_rhs, a, n_eq, pivots, b, n_eq, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Singular matrix'\n    if one_eq:\n        return Numeric.ravel(b) # I see no need to copy here\n    else:\n        return Numeric.transpose(b) # no need to copy\n\n\n# Matrix inversion\n\ndef inverse(a):\n    return solve_linear_equations(a, Numeric.identity(a.shape[0]))\n\n\n# Cholesky decomposition\n\ndef cholesky_decomposition(a):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    a = _castCopyAndTranspose(t, a)\n    m = a.shape[0]\n    n = a.shape[1]\n    if _array_kind[t] == 1:\n        lapack_routine = lapack_lite.zpotrf\n    else:\n        lapack_routine = lapack_lite.dpotrf\n    results = lapack_routine('L', n, a, m, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Matrix is not positive definite - Cholesky decomposition cannot be computed'\n    return Numeric.transpose(MLab.triu(a,k=0)).copy()\n\n\n# Eigenvalues\n\ndef eigenvalues(a):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _fastCopyAndTranspose(t, a)\n    n = a.shape[0]\n    dummy = Numeric.zeros((1,), t)\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgeev\n        w = Numeric.zeros((n,), t)\n        rwork = Numeric.zeros((n,),real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, w,\n                                 dummy, 1, dummy, 1, work, -1, rwork, 0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, w,\n                                 dummy, 1, dummy, 1, work, lwork, rwork, 0)\n    else:\n        lapack_routine = lapack_lite.dgeev\n        wr = Numeric.zeros((n,), t)\n        wi = Numeric.zeros((n,), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, wr, wi,\n                                 dummy, 1, dummy, 1, work, -1, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, wr, wi,\n                                 dummy, 1, dummy, 1, work, lwork, 0)\n        if Numeric.logical_and.reduce(Numeric.equal(wi, 0.)):\n            w = wr\n        else:\n            w = wr+1j*wi\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w\n\n\ndef Heigenvalues(a, UPLO='L'):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _castCopyAndTranspose(t, a)\n    n = a.shape[0]\n    liwork = 5*n+3\n    iwork = Numeric.zeros((liwork,),'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zheevd\n        w = Numeric.zeros((n,), real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        lrwork = 1\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, -1, rwork, -1, iwork, liwork,  0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        lrwork = int(rwork[0])\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, lwork, rwork, lrwork, iwork, liwork,  0)\n    else:\n        lapack_routine = lapack_lite.dsyevd\n        w = Numeric.zeros((n,), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, -1, iwork, liwork, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, lwork, iwork, liwork, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w\n\ndef _convertarray(a):\n    if issubclass(a.dtype, Numeric.complexfloating):\n        if a.dtypechar == 'D':\n            a = _fastCT(a)\n        else:\n            a = _fastCT(a.astype('D'))\n    else:\n        if a.dtypechar == 'd':\n            a = _fastCT(a)\n        else:\n            a = _fastCT(a.astype('d'))\n    return a, a.dtypechar\n\n# Eigenvectors\n\ndef eigenvectors(a):\n    \"\"\"eigenvectors(a) returns u,v  where u is the eigenvalues and\nv is a matrix of eigenvectors with vector v[i] corresponds to\neigenvalue u[i].  Satisfies the equation dot(a, v[i]) = u[i]*v[i]\n\"\"\"\n    a = asarray(a)    \n    _assertRank2(a)\n    _assertSquareness(a)\n    a,t = _convertarray(a) # convert to float_ or complex_ type\n    wrap = a.__array_wrap__\n    real_t = 'd'\n    n = a.shape[0]\n    dummy = Numeric.zeros((1,), t)\n    if t == 'D': # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgeev\n        w = Numeric.zeros((n,), t)\n        v = Numeric.zeros((n,n), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,),t)\n        rwork = Numeric.zeros((2*n,),real_t)\n        results = lapack_routine('N', 'V', n, a, n, w,\n                                  dummy, 1, v, n, work, -1, rwork, 0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('N', 'V', n, a, n, w,\n                                  dummy, 1, v, n, work, lwork, rwork, 0)\n    else:\n        lapack_routine = lapack_lite.dgeev\n        wr = Numeric.zeros((n,), t)\n        wi = Numeric.zeros((n,), t)\n        vr = Numeric.zeros((n,n), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('N', 'V', n, a, n, wr, wi,\n                                  dummy, 1, vr, n, work, -1, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('N', 'V', n, a, n, wr, wi,\n                                  dummy, 1, vr, n, work, lwork, 0)\n        if Numeric.logical_and.reduce(Numeric.equal(wi, 0.)):\n            w = wr\n            v = vr\n        else:\n            w = wr+1j*wi\n            v = Numeric.array(vr,Numeric.Complex)\n            ind = Numeric.nonzero(\n                          Numeric.equal(\n                              Numeric.equal(wi,0.0) # true for real e-vals\n                                       ,0)          # true for complex e-vals\n                                 )                  # indices of complex e-vals\n            for i in range(len(ind)/2):\n                v[ind[2*i]] = vr[ind[2*i]] + 1j*vr[ind[2*i+1]]\n                v[ind[2*i+1]] = vr[ind[2*i]] - 1j*vr[ind[2*i+1]]\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w,wrap(v)\n\n\ndef Heigenvectors(a, UPLO='L'):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _castCopyAndTranspose(t, a)\n    wrap = a.__array_wrap__\n    n = a.shape[0]\n    liwork = 5*n+3\n    iwork = Numeric.zeros((liwork,),'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zheevd\n        w = Numeric.zeros((n,), real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        lrwork = 1\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, -1, rwork, -1, iwork, liwork,  0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        lrwork = int(rwork[0])\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, lwork, rwork, lrwork, iwork, liwork,  0)\n    else:\n        lapack_routine = lapack_lite.dsyevd\n        w = Numeric.zeros((n,), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, -1, iwork, liwork, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, lwork, iwork, liwork, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w,wrap(a)\n\n\n# Singular value decomposition\n\ndef singular_value_decomposition(a, full_matrices = 0):\n    _assertRank2(a)\n    n = a.shape[1]\n    m = a.shape[0]\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _fastCopyAndTranspose(t, a)\n    wrap = a.__array_wrap__\n    if full_matrices:\n        nu = m\n        nvt = n\n        option = 'A'\n    else:\n        nu = min(n,m)\n        nvt = min(n,m)\n        option = 'S'\n    s = Numeric.zeros((min(n,m),), real_t)\n    u = Numeric.zeros((nu, m), t)\n    vt = Numeric.zeros((n, nvt), t)\n    iwork = Numeric.zeros((8*min(m,n),), 'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgesdd\n        rwork = Numeric.zeros((5*min(m,n)*min(m,n) + 5*min(m,n),), real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, -1, rwork, iwork, 0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, lwork, rwork, iwork, 0)\n    else:\n        lapack_routine = lapack_lite.dgesdd\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, -1, iwork, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, lwork, iwork, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'SVD did not converge'\n    return wrap(Numeric.transpose(u)), s, \\\n           wrap(Numeric.transpose(vt)) # why copy here?\n\n\n# Generalized inverse\n\ndef generalized_inverse(a, rcond = 1.e-10):\n    a = Numeric.array(a, copy=0)\n    if a.dtypechar in Numeric.typecodes['Complex']:\n        a = Numeric.conjugate(a)\n    u, s, vt = singular_value_decomposition(a, 0)\n    m = u.shape[0]\n    n = vt.shape[1]\n    cutoff = rcond*Numeric.maximum.reduce(s)\n    for i in range(min(n,m)):\n        if s[i] > cutoff:\n            s[i] = 1./s[i]\n        else:\n            s[i] = 0.;\n    wrap = a.__array_wrap__\n    return wrap(Numeric.dot(Numeric.transpose(vt),                        \n                       multiply(s[:, Numeric.NewAxis],Numeric.transpose(u))))\n\n# Determinant\n\ndef determinant(a):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    a = _fastCopyAndTranspose(t, a)\n    n = a.shape[0]\n    if _array_kind[t] == 1:\n        lapack_routine = lapack_lite.zgetrf\n    else:\n        lapack_routine = lapack_lite.dgetrf\n    pivots = Numeric.zeros((n,), 'i')\n    results = lapack_routine(n, n, a, n, pivots, 0)\n    sign = Numeric.add.reduce(Numeric.not_equal(pivots,\n                                                Numeric.arrayrange(1, n+1))) % 2\n    return (1.-2.*sign)*Numeric.multiply.reduce(Numeric.diagonal(a),axis=-1)\n\n# Linear Least Squares\n\ndef linear_least_squares(a, b, rcond=1.e-10):\n    \"\"\"returns x,resids,rank,s\nwhere x minimizes 2-norm(|b - Ax|)\n      resids is the sum square residuals\n      rank is the rank of A\n      s is the rank of the singular values of A in descending order\n\nIf b is a matrix then x is also a matrix with corresponding columns.\nIf the rank of A is less than the number of columns of A or greater than\nthe number of rows, then residuals will be returned as an empty array\notherwise resids = sum((b-dot(A,x)**2).\nSingular values less than s[0]*rcond are treated as zero.\n\"\"\"\n    a = asarray(a)\n    b = asarray(b)\n    one_eq = len(b.shape) == 1\n    if one_eq:\n        b = b[:, Numeric.NewAxis]\n    _assertRank2(a, b)\n    m  = a.shape[0]\n    n  = a.shape[1]\n    n_rhs = b.shape[1]\n    ldb = max(n,m)\n    if m != b.shape[0]:\n        raise LinAlgError, 'Incompatible dimensions'\n    t =_commonType(a, b)\n    real_t = _array_type[0][_array_precision[t]]\n    bstar = Numeric.zeros((ldb,n_rhs),t)\n    bstar[:b.shape[0],:n_rhs] = b.copy()\n    a,bstar = _castCopyAndTranspose(t, a, bstar)\n    s = Numeric.zeros((min(m,n),),real_t)\n    nlvl = max( 0, int( math.log( float(min( m,n ))/2. ) ) + 1 )\n    iwork = Numeric.zeros((3*min(m,n)*nlvl+11*min(m,n),), 'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgelsd\n        lwork = 1\n        rwork = Numeric.zeros((lwork,), real_t)\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,-1,rwork,iwork,0 )\n        lwork = int(abs(work[0]))\n        rwork = Numeric.zeros((lwork,),real_t)\n        a_real = Numeric.zeros((m,n),real_t)\n        bstar_real = Numeric.zeros((ldb,n_rhs,),real_t)\n        results = lapack_lite.dgelsd( m, n, n_rhs, a_real, m, bstar_real,ldb , s, rcond,\n                        0,rwork,-1,iwork,0 )\n        lrwork = int(rwork[0])\n        work = Numeric.zeros((lwork,), t)\n        rwork = Numeric.zeros((lrwork,), real_t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,lwork,rwork,iwork,0 )\n    else:\n        lapack_routine = lapack_lite.dgelsd\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,-1,iwork,0 )\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,lwork,iwork,0 )\n    if results['info'] > 0:\n        raise LinAlgError, 'SVD did not converge in Linear Least Squares'\n    resids = Numeric.array([],t)\n    if one_eq:\n        x = Numeric.ravel(bstar)[:n].copy()\n        if (results['rank']==n) and (m>n):\n            resids = Numeric.array([Numeric.sum((Numeric.ravel(bstar)[n:])**2)])\n    else:\n        x = Numeric.transpose(bstar)[:n,:].copy()\n        if (results['rank']==n) and (m>n):\n            resids = Numeric.sum((Numeric.transpose(bstar)[n:,:])**2).copy()\n    return x,resids,results['rank'],s[:min(n,m)].copy()\n\n\nif __name__ == '__main__':\n    from scipy.base import *\n\n    def test(a, b):\n\n        print \"All numbers printed should be (almost) zero:\"\n\n        x = solve_linear_equations(a, b)\n        check = b - matrixmultiply(a, x)\n        print check\n\n\n        a_inv = inverse(a)\n        check = matrixmultiply(a, a_inv)-identity(a.shape[0])\n        print check\n\n\n        ev = eigenvalues(a)\n\n        evalues, evectors = eigenvectors(a)\n        check = ev-evalues\n        print check\n\n        evectors = transpose(evectors)\n        check = matrixmultiply(a, evectors)-evectors*evalues\n        print check\n\n\n        u, s, vt = singular_value_decomposition(a)\n        check = a - Numeric.matrixmultiply(u*s, vt)\n        print check\n\n\n        a_ginv = generalized_inverse(a)\n        check = matrixmultiply(a, a_ginv)-identity(a.shape[0])\n        print check\n\n\n        det = determinant(a)\n        check = det-multiply.reduce(evalues)\n        print check\n\n        x, residuals, rank, sv = linear_least_squares(a, b)\n        check = b - matrixmultiply(a, x)\n        print check\n        print rank-a.shape[0]\n        print sv-s\n\n    a = array([[1.,2.], [3.,4.]])\n    b = array([2., 1.])\n    test(a, b)\n\n    a = a+0j\n    b = b+0j\n    test(a, b)\n",
                "source_code_before": "# This module is a lite version of LinAlg.py module which contains\n# high-level Python interface to the LAPACK library.  The lite version\n# only accesses the following LAPACK functions: dgesv, zgesv, dgeev,\n# zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf, dpotrf.\n\nimport scipy.base as Numeric\nimport scipy.lib.lapack_lite as lapack_lite\nMLab = Numeric\nfrom scipy.base import asarray, multiply\nimport math\n\n# Error object\nclass LinAlgError(Exception):\n    pass\n\n# Helper routines\n_lapack_type = {'f': 0, 'd': 1, 'F': 2, 'D': 3}\n_lapack_letter = ['s', 'd', 'c', 'z']\n_array_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\n_array_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\n_array_type = [['f', 'd'], ['F', 'D']]\n\ndef _commonType(*arrays):\n    kind = 0\n#    precision = 0\n#   force higher precision in lite version\n    precision = 1\n    for a in arrays:\n        t = a.dtypechar\n        kind = max(kind, _array_kind[t])\n        precision = max(precision, _array_precision[t])\n    return _array_type[kind][precision]\n\ndef _castCopyAndTranspose(type, *arrays):\n    cast_arrays = ()\n    for a in arrays:\n        cast_arrays = cast_arrays + (Numeric.transpose(a).astype(type),)\n    if len(cast_arrays) == 1:\n            return cast_arrays[0]\n    else:\n        return cast_arrays\n\n# _fastCopyAndTranpose is an optimized version of _castCopyAndTranspose.\n# It assumes the input is 2D (as all the calls in here are).\n\n_fastCT = Numeric.fastCopyAndTranspose\n\ndef _fastCopyAndTranspose(type, *arrays):\n    cast_arrays = ()\n    for a in arrays:\n        if a.dtypechar == type:\n            cast_arrays = cast_arrays + (_fastCT(a),)\n        else:\n            cast_arrays = cast_arrays + (_fastCT(a.astype(type)),)\n    if len(cast_arrays) == 1:\n            return cast_arrays[0]\n    else:\n        return cast_arrays\n\ndef _assertRank2(*arrays):\n    for a in arrays:\n        if len(a.shape) != 2:\n            raise LinAlgError, 'Array must be two-dimensional'\n\ndef _assertSquareness(*arrays):\n    for a in arrays:\n        if max(a.shape) != min(a.shape):\n            raise LinAlgError, 'Array must be square'\n\n\n# Linear equations\n\ndef solve_linear_equations(a, b):\n    one_eq = len(b.shape) == 1\n    if one_eq:\n        b = b[:, Numeric.NewAxis]\n    _assertRank2(a, b)\n    _assertSquareness(a)\n    n_eq = a.shape[0]\n    n_rhs = b.shape[1]\n    if n_eq != b.shape[0]:\n        raise LinAlgError, 'Incompatible dimensions'\n    t =_commonType(a, b)\n#    lapack_routine = _findLapackRoutine('gesv', t)\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgesv\n    else:\n        lapack_routine = lapack_lite.dgesv\n    a, b = _fastCopyAndTranspose(t, a, b)\n    pivots = Numeric.zeros(n_eq, 'i')\n    results = lapack_routine(n_eq, n_rhs, a, n_eq, pivots, b, n_eq, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Singular matrix'\n    if one_eq:\n        return Numeric.ravel(b) # I see no need to copy here\n    else:\n        return Numeric.transpose(b) # no need to copy\n\n\n# Matrix inversion\n\ndef inverse(a):\n    return solve_linear_equations(a, Numeric.identity(a.shape[0]))\n\n\n# Cholesky decomposition\n\ndef cholesky_decomposition(a):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    a = _castCopyAndTranspose(t, a)\n    m = a.shape[0]\n    n = a.shape[1]\n    if _array_kind[t] == 1:\n        lapack_routine = lapack_lite.zpotrf\n    else:\n        lapack_routine = lapack_lite.dpotrf\n    results = lapack_routine('L', n, a, m, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Matrix is not positive definite - Cholesky decomposition cannot be computed'\n    return Numeric.transpose(MLab.triu(a,k=0)).copy()\n\n\n# Eigenvalues\n\ndef eigenvalues(a):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _fastCopyAndTranspose(t, a)\n    n = a.shape[0]\n    dummy = Numeric.zeros((1,), t)\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgeev\n        w = Numeric.zeros((n,), t)\n        rwork = Numeric.zeros((n,),real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, w,\n                                 dummy, 1, dummy, 1, work, -1, rwork, 0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, w,\n                                 dummy, 1, dummy, 1, work, lwork, rwork, 0)\n    else:\n        lapack_routine = lapack_lite.dgeev\n        wr = Numeric.zeros((n,), t)\n        wi = Numeric.zeros((n,), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, wr, wi,\n                                 dummy, 1, dummy, 1, work, -1, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', 'N', n, a, n, wr, wi,\n                                 dummy, 1, dummy, 1, work, lwork, 0)\n        if Numeric.logical_and.reduce(Numeric.equal(wi, 0.)):\n            w = wr\n        else:\n            w = wr+1j*wi\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w\n\n\ndef Heigenvalues(a, UPLO='L'):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _castCopyAndTranspose(t, a)\n    n = a.shape[0]\n    liwork = 5*n+3\n    iwork = Numeric.zeros((liwork,),'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zheevd\n        w = Numeric.zeros((n,), real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        lrwork = 1\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, -1, rwork, -1, iwork, liwork,  0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        lrwork = int(rwork[0])\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, lwork, rwork, lrwork, iwork, liwork,  0)\n    else:\n        lapack_routine = lapack_lite.dsyevd\n        w = Numeric.zeros((n,), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, -1, iwork, liwork, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine('N', UPLO, n, a, n,w, work, lwork, iwork, liwork, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w\n\ndef _convertarray(a):\n    if issubclass(a.dtype, Numeric.complexfloating):\n        if a.dtypechar == 'D':\n            a = _fastCT(a)\n        else:\n            a = _fastCT(a.astype('D'))\n    else:\n        if a.dtypechar == 'd':\n            a = _fastCT(a)\n        else:\n            a = _fastCT(a.astype('d'))\n    return a, a.dtypechar\n\n# Eigenvectors\n\ndef eigenvectors(a):\n    \"\"\"eigenvectors(a) returns u,v  where u is the eigenvalues and\nv is a matrix of eigenvectors with vector v[i] corresponds to\neigenvalue u[i].  Satisfies the equation dot(a, v[i]) = u[i]*v[i]\n\"\"\"\n    a = asarray(a)    \n    _assertRank2(a)\n    _assertSquareness(a)\n    a,t = _convertarray(a) # convert to float_ or complex_ type\n    wrap = a.__array_wrap__\n    real_t = 'd'\n    n = a.shape[0]\n    dummy = Numeric.zeros((1,), t)\n    if t == 'D': # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgeev\n        w = Numeric.zeros((n,), t)\n        v = Numeric.zeros((n,n), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,),t)\n        rwork = Numeric.zeros((2*n,),real_t)\n        results = lapack_routine('N', 'V', n, a, n, w,\n                                  dummy, 1, v, n, work, -1, rwork, 0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('N', 'V', n, a, n, w,\n                                  dummy, 1, v, n, work, lwork, rwork, 0)\n    else:\n        lapack_routine = lapack_lite.dgeev\n        wr = Numeric.zeros((n,), t)\n        wi = Numeric.zeros((n,), t)\n        vr = Numeric.zeros((n,n), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('N', 'V', n, a, n, wr, wi,\n                                  dummy, 1, vr, n, work, -1, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('N', 'V', n, a, n, wr, wi,\n                                  dummy, 1, vr, n, work, lwork, 0)\n        if Numeric.logical_and.reduce(Numeric.equal(wi, 0.)):\n            w = wr\n            v = vr\n        else:\n            w = wr+1j*wi\n            v = Numeric.array(vr,Numeric.Complex)\n            ind = Numeric.nonzero(\n                          Numeric.equal(\n                              Numeric.equal(wi,0.0) # true for real e-vals\n                                       ,0)          # true for complex e-vals\n                                 )                  # indices of complex e-vals\n            for i in range(len(ind)/2):\n                v[ind[2*i]] = vr[ind[2*i]] + 1j*vr[ind[2*i+1]]\n                v[ind[2*i+1]] = vr[ind[2*i]] - 1j*vr[ind[2*i+1]]\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w,wrap(v)\n\n\ndef Heigenvectors(a, UPLO='L'):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _castCopyAndTranspose(t, a)\n    wrap = a.__array_wrap__\n    n = a.shape[0]\n    liwork = 5*n+3\n    iwork = Numeric.zeros((liwork,),'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zheevd\n        w = Numeric.zeros((n,), real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        lrwork = 1\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, -1, rwork, -1, iwork, liwork,  0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        lrwork = int(rwork[0])\n        rwork = Numeric.zeros((lrwork,),real_t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, lwork, rwork, lrwork, iwork, liwork,  0)\n    else:\n        lapack_routine = lapack_lite.dsyevd\n        w = Numeric.zeros((n,), t)\n        lwork = 1\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, -1, iwork, liwork, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine('V', UPLO, n, a, n,w, work, lwork, iwork, liwork, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'Eigenvalues did not converge'\n    return w,wrap(a)\n\n\n# Singular value decomposition\n\ndef singular_value_decomposition(a, full_matrices = 0):\n    _assertRank2(a)\n    n = a.shape[1]\n    m = a.shape[0]\n    t =_commonType(a)\n    real_t = _array_type[0][_array_precision[t]]\n    a = _fastCopyAndTranspose(t, a)\n    wrap = a.__array_wrap__\n    if full_matrices:\n        nu = m\n        nvt = n\n        option = 'A'\n    else:\n        nu = min(n,m)\n        nvt = min(n,m)\n        option = 'S'\n    s = Numeric.zeros((min(n,m),), real_t)\n    u = Numeric.zeros((nu, m), t)\n    vt = Numeric.zeros((n, nvt), t)\n    iwork = Numeric.zeros((8*min(m,n),), 'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgesdd\n        rwork = Numeric.zeros((5*min(m,n)*min(m,n) + 5*min(m,n),), real_t)\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, -1, rwork, iwork, 0)\n        lwork = int(abs(work[0]))\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, lwork, rwork, iwork, 0)\n    else:\n        lapack_routine = lapack_lite.dgesdd\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, -1, iwork, 0)\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt,\n                                 work, lwork, iwork, 0)\n    if results['info'] > 0:\n        raise LinAlgError, 'SVD did not converge'\n    return wrap(Numeric.transpose(u)), s, \\\n           wrap(Numeric.transpose(vt)) # why copy here?\n\n\n# Generalized inverse\n\ndef generalized_inverse(a, rcond = 1.e-10):\n    a = Numeric.array(a, copy=0)\n    if a.dtypechar in Numeric.typecodes['Complex']:\n        a = Numeric.conjugate(a)\n    u, s, vt = singular_value_decomposition(a, 0)\n    m = u.shape[0]\n    n = vt.shape[1]\n    cutoff = rcond*Numeric.maximum.reduce(s)\n    for i in range(min(n,m)):\n        if s[i] > cutoff:\n            s[i] = 1./s[i]\n        else:\n            s[i] = 0.;\n    wrap = a.__array_wrap__\n    return wrap(Numeric.dot(Numeric.transpose(vt),                        \n                       multiply(s[:, Numeric.NewAxis],Numeric.transpose(u))))\n\n# Determinant\n\ndef determinant(a):\n    _assertRank2(a)\n    _assertSquareness(a)\n    t =_commonType(a)\n    a = _fastCopyAndTranspose(t, a)\n    n = a.shape[0]\n    if _array_kind[t] == 1:\n        lapack_routine = lapack_lite.zgetrf\n    else:\n        lapack_routine = lapack_lite.dgetrf\n    pivots = Numeric.zeros((n,), 'i')\n    results = lapack_routine(n, n, a, n, pivots, 0)\n    sign = Numeric.add.reduce(Numeric.not_equal(pivots,\n                                                Numeric.arrayrange(1, n+1))) % 2\n    return (1.-2.*sign)*Numeric.multiply.reduce(Numeric.diagonal(a),axis=-1)\n\n# Linear Least Squares\n\ndef linear_least_squares(a, b, rcond=1.e-10):\n    \"\"\"returns x,resids,rank,s\nwhere x minimizes 2-norm(|b - Ax|)\n      resids is the sum square residuals\n      rank is the rank of A\n      s is the rank of the singular values of A in descending order\n\nIf b is a matrix then x is also a matrix with corresponding columns.\nIf the rank of A is less than the number of columns of A or greater than\nthe number of rows, then residuals will be returned as an empty array\notherwise resids = sum((b-dot(A,x)**2).\nSingular values less than s[0]*rcond are treated as zero.\n\"\"\"\n    a = asndarray(a)\n    b = asndarary(b)\n    one_eq = len(b.shape) == 1\n    if one_eq:\n        b = b[:, Numeric.NewAxis]\n    _assertRank2(a, b)\n    m  = a.shape[0]\n    n  = a.shape[1]\n    n_rhs = b.shape[1]\n    ldb = max(n,m)\n    if m != b.shape[0]:\n        raise LinAlgError, 'Incompatible dimensions'\n    t =_commonType(a, b)\n    real_t = _array_type[0][_array_precision[t]]\n    bstar = Numeric.zeros((ldb,n_rhs),t)\n    bstar[:b.shape[0],:n_rhs] = b.copy()\n    a,bstar = _castCopyAndTranspose(t, a, bstar)\n    s = Numeric.zeros((min(m,n),),real_t)\n    nlvl = max( 0, int( math.log( float(min( m,n ))/2. ) ) + 1 )\n    iwork = Numeric.zeros((3*min(m,n)*nlvl+11*min(m,n),), 'i')\n    if _array_kind[t] == 1: # Complex routines take different arguments\n        lapack_routine = lapack_lite.zgelsd\n        lwork = 1\n        rwork = Numeric.zeros((lwork,), real_t)\n        work = Numeric.zeros((lwork,),t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,-1,rwork,iwork,0 )\n        lwork = int(abs(work[0]))\n        rwork = Numeric.zeros((lwork,),real_t)\n        a_real = Numeric.zeros((m,n),real_t)\n        bstar_real = Numeric.zeros((ldb,n_rhs,),real_t)\n        results = lapack_lite.dgelsd( m, n, n_rhs, a_real, m, bstar_real,ldb , s, rcond,\n                        0,rwork,-1,iwork,0 )\n        lrwork = int(rwork[0])\n        work = Numeric.zeros((lwork,), t)\n        rwork = Numeric.zeros((lrwork,), real_t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,lwork,rwork,iwork,0 )\n    else:\n        lapack_routine = lapack_lite.dgelsd\n        lwork = 1\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,-1,iwork,0 )\n        lwork = int(work[0])\n        work = Numeric.zeros((lwork,), t)\n        results = lapack_routine( m, n, n_rhs, a, m, bstar,ldb , s, rcond,\n                        0,work,lwork,iwork,0 )\n    if results['info'] > 0:\n        raise LinAlgError, 'SVD did not converge in Linear Least Squares'\n    resids = Numeric.array([],t)\n    if one_eq:\n        x = Numeric.ravel(bstar)[:n].copy()\n        if (results['rank']==n) and (m>n):\n            resids = Numeric.array([Numeric.sum((Numeric.ravel(bstar)[n:])**2)])\n    else:\n        x = Numeric.transpose(bstar)[:n,:].copy()\n        if (results['rank']==n) and (m>n):\n            resids = Numeric.sum((Numeric.transpose(bstar)[n:,:])**2).copy()\n    return x,resids,results['rank'],s[:min(n,m)].copy()\n\n\nif __name__ == '__main__':\n    from scipy.base import *\n\n    def test(a, b):\n\n        print \"All numbers printed should be (almost) zero:\"\n\n        x = solve_linear_equations(a, b)\n        check = b - matrixmultiply(a, x)\n        print check\n\n\n        a_inv = inverse(a)\n        check = matrixmultiply(a, a_inv)-identity(a.shape[0])\n        print check\n\n\n        ev = eigenvalues(a)\n\n        evalues, evectors = eigenvectors(a)\n        check = ev-evalues\n        print check\n\n        evectors = transpose(evectors)\n        check = matrixmultiply(a, evectors)-evectors*evalues\n        print check\n\n\n        u, s, vt = singular_value_decomposition(a)\n        check = a - Numeric.matrixmultiply(u*s, vt)\n        print check\n\n\n        a_ginv = generalized_inverse(a)\n        check = matrixmultiply(a, a_ginv)-identity(a.shape[0])\n        print check\n\n\n        det = determinant(a)\n        check = det-multiply.reduce(evalues)\n        print check\n\n        x, residuals, rank, sv = linear_least_squares(a, b)\n        check = b - matrixmultiply(a, x)\n        print check\n        print rank-a.shape[0]\n        print sv-s\n\n    a = array([[1.,2.], [3.,4.]])\n    b = array([2., 1.])\n    test(a, b)\n\n    a = a+0j\n    b = b+0j\n    test(a, b)\n",
                "methods": [
                    {
                        "name": "_commonType",
                        "long_name": "_commonType( * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 52,
                        "parameters": [
                            "arrays"
                        ],
                        "start_line": 23,
                        "end_line": 32,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_castCopyAndTranspose",
                        "long_name": "_castCopyAndTranspose( type , * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 52,
                        "parameters": [
                            "type",
                            "arrays"
                        ],
                        "start_line": 34,
                        "end_line": 41,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fastCopyAndTranspose",
                        "long_name": "_fastCopyAndTranspose( type , * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "type",
                            "arrays"
                        ],
                        "start_line": 48,
                        "end_line": 58,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_assertRank2",
                        "long_name": "_assertRank2( * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 4,
                        "complexity": 3,
                        "token_count": 25,
                        "parameters": [
                            "arrays"
                        ],
                        "start_line": 60,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_assertSquareness",
                        "long_name": "_assertSquareness( * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 4,
                        "complexity": 3,
                        "token_count": 30,
                        "parameters": [
                            "arrays"
                        ],
                        "start_line": 65,
                        "end_line": 68,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "solve_linear_equations",
                        "long_name": "solve_linear_equations( a , b )",
                        "filename": "basic_lite.py",
                        "nloc": 24,
                        "complexity": 6,
                        "token_count": 171,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 73,
                        "end_line": 97,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "inverse",
                        "long_name": "inverse( a )",
                        "filename": "basic_lite.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 22,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 102,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cholesky_decomposition",
                        "long_name": "cholesky_decomposition( a )",
                        "filename": "basic_lite.py",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 109,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 108,
                        "end_line": 122,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "eigenvalues",
                        "long_name": "eigenvalues( a )",
                        "filename": "basic_lite.py",
                        "nloc": 39,
                        "complexity": 4,
                        "token_count": 385,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 127,
                        "end_line": 165,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Heigenvalues",
                        "long_name": "Heigenvalues( a , UPLO = 'L' )",
                        "filename": "basic_lite.py",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 363,
                        "parameters": [
                            "a",
                            "UPLO"
                        ],
                        "start_line": 168,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convertarray",
                        "long_name": "_convertarray( a )",
                        "filename": "basic_lite.py",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 77,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 203,
                        "end_line": 214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "eigenvectors",
                        "long_name": "eigenvectors( a )",
                        "filename": "basic_lite.py",
                        "nloc": 52,
                        "complexity": 5,
                        "token_count": 534,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 218,
                        "end_line": 273,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Heigenvectors",
                        "long_name": "Heigenvectors( a , UPLO = 'L' )",
                        "filename": "basic_lite.py",
                        "nloc": 35,
                        "complexity": 3,
                        "token_count": 373,
                        "parameters": [
                            "a",
                            "UPLO"
                        ],
                        "start_line": 276,
                        "end_line": 310,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "singular_value_decomposition",
                        "long_name": "singular_value_decomposition( a , full_matrices = 0 )",
                        "filename": "basic_lite.py",
                        "nloc": 45,
                        "complexity": 4,
                        "token_count": 463,
                        "parameters": [
                            "a",
                            "full_matrices"
                        ],
                        "start_line": 315,
                        "end_line": 359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 45,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "generalized_inverse",
                        "long_name": "generalized_inverse( a , rcond = 1 . e - 10 )",
                        "filename": "basic_lite.py",
                        "nloc": 16,
                        "complexity": 4,
                        "token_count": 167,
                        "parameters": [
                            "a",
                            "rcond"
                        ],
                        "start_line": 364,
                        "end_line": 379,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "determinant",
                        "long_name": "determinant( a )",
                        "filename": "basic_lite.py",
                        "nloc": 15,
                        "complexity": 2,
                        "token_count": 141,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 383,
                        "end_line": 397,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "linear_least_squares",
                        "long_name": "linear_least_squares( a , b , rcond = 1 . e - 10 )",
                        "filename": "basic_lite.py",
                        "nloc": 61,
                        "complexity": 10,
                        "token_count": 764,
                        "parameters": [
                            "a",
                            "b",
                            "rcond"
                        ],
                        "start_line": 401,
                        "end_line": 473,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "test",
                        "long_name": "test( a , b )",
                        "filename": "basic_lite.py",
                        "nloc": 29,
                        "complexity": 1,
                        "token_count": 205,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 479,
                        "end_line": 522,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "top_nesting_level": 1
                    }
                ],
                "methods_before": [
                    {
                        "name": "_commonType",
                        "long_name": "_commonType( * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 52,
                        "parameters": [
                            "arrays"
                        ],
                        "start_line": 23,
                        "end_line": 32,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_castCopyAndTranspose",
                        "long_name": "_castCopyAndTranspose( type , * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 52,
                        "parameters": [
                            "type",
                            "arrays"
                        ],
                        "start_line": 34,
                        "end_line": 41,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fastCopyAndTranspose",
                        "long_name": "_fastCopyAndTranspose( type , * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "type",
                            "arrays"
                        ],
                        "start_line": 48,
                        "end_line": 58,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_assertRank2",
                        "long_name": "_assertRank2( * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 4,
                        "complexity": 3,
                        "token_count": 25,
                        "parameters": [
                            "arrays"
                        ],
                        "start_line": 60,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_assertSquareness",
                        "long_name": "_assertSquareness( * arrays )",
                        "filename": "basic_lite.py",
                        "nloc": 4,
                        "complexity": 3,
                        "token_count": 30,
                        "parameters": [
                            "arrays"
                        ],
                        "start_line": 65,
                        "end_line": 68,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "solve_linear_equations",
                        "long_name": "solve_linear_equations( a , b )",
                        "filename": "basic_lite.py",
                        "nloc": 24,
                        "complexity": 6,
                        "token_count": 171,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 73,
                        "end_line": 97,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "inverse",
                        "long_name": "inverse( a )",
                        "filename": "basic_lite.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 22,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 102,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cholesky_decomposition",
                        "long_name": "cholesky_decomposition( a )",
                        "filename": "basic_lite.py",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 109,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 108,
                        "end_line": 122,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "eigenvalues",
                        "long_name": "eigenvalues( a )",
                        "filename": "basic_lite.py",
                        "nloc": 39,
                        "complexity": 4,
                        "token_count": 385,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 127,
                        "end_line": 165,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Heigenvalues",
                        "long_name": "Heigenvalues( a , UPLO = 'L' )",
                        "filename": "basic_lite.py",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 363,
                        "parameters": [
                            "a",
                            "UPLO"
                        ],
                        "start_line": 168,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convertarray",
                        "long_name": "_convertarray( a )",
                        "filename": "basic_lite.py",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 77,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 203,
                        "end_line": 214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "eigenvectors",
                        "long_name": "eigenvectors( a )",
                        "filename": "basic_lite.py",
                        "nloc": 52,
                        "complexity": 5,
                        "token_count": 534,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 218,
                        "end_line": 273,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Heigenvectors",
                        "long_name": "Heigenvectors( a , UPLO = 'L' )",
                        "filename": "basic_lite.py",
                        "nloc": 35,
                        "complexity": 3,
                        "token_count": 373,
                        "parameters": [
                            "a",
                            "UPLO"
                        ],
                        "start_line": 276,
                        "end_line": 310,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "singular_value_decomposition",
                        "long_name": "singular_value_decomposition( a , full_matrices = 0 )",
                        "filename": "basic_lite.py",
                        "nloc": 45,
                        "complexity": 4,
                        "token_count": 463,
                        "parameters": [
                            "a",
                            "full_matrices"
                        ],
                        "start_line": 315,
                        "end_line": 359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 45,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "generalized_inverse",
                        "long_name": "generalized_inverse( a , rcond = 1 . e - 10 )",
                        "filename": "basic_lite.py",
                        "nloc": 16,
                        "complexity": 4,
                        "token_count": 167,
                        "parameters": [
                            "a",
                            "rcond"
                        ],
                        "start_line": 364,
                        "end_line": 379,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "determinant",
                        "long_name": "determinant( a )",
                        "filename": "basic_lite.py",
                        "nloc": 15,
                        "complexity": 2,
                        "token_count": 141,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 383,
                        "end_line": 397,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "linear_least_squares",
                        "long_name": "linear_least_squares( a , b , rcond = 1 . e - 10 )",
                        "filename": "basic_lite.py",
                        "nloc": 61,
                        "complexity": 10,
                        "token_count": 764,
                        "parameters": [
                            "a",
                            "b",
                            "rcond"
                        ],
                        "start_line": 401,
                        "end_line": 473,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "test",
                        "long_name": "test( a , b )",
                        "filename": "basic_lite.py",
                        "nloc": 29,
                        "complexity": 1,
                        "token_count": 205,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 479,
                        "end_line": 522,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "top_nesting_level": 1
                    }
                ],
                "changed_methods": [
                    {
                        "name": "linear_least_squares",
                        "long_name": "linear_least_squares( a , b , rcond = 1 . e - 10 )",
                        "filename": "basic_lite.py",
                        "nloc": 61,
                        "complexity": 10,
                        "token_count": 764,
                        "parameters": [
                            "a",
                            "b",
                            "rcond"
                        ],
                        "start_line": 401,
                        "end_line": 473,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 435,
                "complexity": 65,
                "token_count": 4226,
                "diff_parsed": {
                    "added": [
                        "    a = asarray(a)",
                        "    b = asarray(b)"
                    ],
                    "deleted": [
                        "    a = asndarray(a)",
                        "    b = asndarary(b)"
                    ]
                }
            },
            {
                "old_path": "scipy/doc/CAPI.txt",
                "new_path": "scipy/doc/CAPI.txt",
                "filename": "CAPI.txt",
                "extension": "txt",
                "change_type": "MODIFY",
                "diff": "@@ -211,6 +211,11 @@ PyArray_Typecode structure\n }\n \n \n+PyArray_ContiguousFromAny(op, typenum, min_depth, max_depth) is equivalent\n+to PyArray_ContiguousFromObject(...) (which is still available), except\n+it will return the subclass if op is already a subclass of the ndarray.  \n+The ContiguousFromObject version will always return an ndarray (or a bigndarray). \n+\n Passing Data Type information to C-code\n ============================================\n \n",
                "added_lines": 5,
                "deleted_lines": 0,
                "source_code": "Author:          Travis Oliphant\nDiscussions to:  scipy-dev@scipy.org\nCreated:         October 2005\n\nThe CAPI of SciPy is (mostly) backward compatible with Numeric.  \n\nThere are a few non-standard Numeric usages (that were not really part\nof the API) that will need to be changed:\n\n  * If you used any of the function pointers in the PyArray_Descr\n    structure you will have to modify your usage of those.  The\n    casting functions have eliminated the strides argument (use\n    PyArray_CastTo if you need strided casting). All functions have\n    one or two PyArrayObject * arguments at the end.  This allows the\n    flexible arrays and mis-behaved arrays to be handled.\n\n  * The descr->zero and descr->one constants have been replaced with\n    function calls, PyArray_Zero, and PyArray_One.\n\n  * You should use PyArray_ITEMSIZE(obj) instead of descr->elsize to\n    get the itemsize of an object (for flexible arrays descr->elsize\n    is 0).\n\n  * If you passed array->dimensions and array->strides around to \n    functions.  These are now, intp* pointers.  On 32-bit systems\n    there won't be a problem.  However, on 64-bit systems, you will\n    need to make changes.  \n\n\nThe header files arrayobject.h and ufuncobject.h contain many defines\nthat you may find useful.  The files __ufunc_api.h and\n__multiarray_api.h contain the available C-API function calls with\ntheir function signatures.\n\nAll of these headers are installed to \n\n<YOUR_PYTHON_LOCATION>/site-packages/scipy/base/include\n\n\nGetting arrays in C-code\n=========================\n\nAll new arrays can be created using PyArray_New.  A simple interface \nequivalent to PyArray_FromDims is PyArray_SimpleNew(nd, dims, typenum)\n\nThis is a very flexible function.  \n\nPyObject * PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type, \n         intp *strides, char *data, int itemsize, int flags, \n         PyObject *obj);\n\n\nsubtype  : The subtype that should be created (either pass in\n             &PyArray_Type, &PyBigArray_Type, or obj->ob_type,\n             where obj is a subtype (or subclass) of \n\t     of PyArray_Type or PyBigArray_Type).\n\nnd       : The number of dimensions (<MAX_DIMS)\n\n*dims    : A pointer to the size in each dimension.  Information will be\n             copied from here.\n\ntype     : An integer specifying the type of the array \n             (use the PyArray_XXXX enumerated types).\n\n*strides : The strides this array should have.  For new arrays created\n             by this routine, this should be NULL.  If you pass in\n             memory for this array to use, then you should pass in the\n             strides information as well.  Any strides will be copied into\n\t     the array structure.   Do not pass in bad strides information.\n\n\t    PyArray_CheckStrides(...) can help but you must call it if you are\n\t     unsure.\n\n*data    : NULL for creating brand-new memory.  If you want this array\n             to wrap another memory area, then pass the pointer here.\n             You are responsible for deleting the memory in that case,\n             but do not do so until the new array object has been\n             deleted.  The best way to handle that is to get the memory\n             from another Python object, INCREF that Python object after\n             passing it's data pointer to this routine, and set the\n             ->base member of the returned array to the Python object.\n             You are responsible for setting the base object.  Failure\n             to do so will create a memory leak.  \n            \n            If you pass in a data buffer, the flags argument will be\n              the flags of the new array. If you create a new array, a\n              non-zero flags argument indicates that you want the array\n              to be in FORTRAN order.\n\nitemsize : Indicates the itemsize for the new array.  This can be 0\n             if it is a fixed-size array type.  It is only used for\n             flexible array types and must be set in that case.\n\n\nflags    : Either the flags showing how to interpret the data buffer\n             passed in.  Or if a new array is created, nonzero to\n             indicate a FORTRAN order array.  See below for an explanation of\n\t     the flags.\n\n\nobj      : If subtypes is &PyArray_Type or &PyBigArray_Type, this\n             argument is ignored.  Otherwise, the __array_finalize__\n             method of the subtype is called (if present) and passed\n             this object.  This is usually an array of the type to be\n             created (so the __array_finalize__ method must handle an\n             array argument.  But, it can be anything...)\n\nNote: The returned array object will be unitialized unless the type is\nPyArray_OBJECT.\n\nPyArray_SimpleNew(nd, dims, typenum)  is a drop-in replacement for \nPyArray_FromDims (except it takes intp* dims instead of int* dims which\n\t\t  matters on 64-bit systems).\n\nPyArray_SimpleNew is just a macro for PyArray_New with default arguments.\n\n\nThe PyArray_FromDims and family of functions are still available and\nare loose wrappers around this function.  These functions still take\nint * arguments.  This should be fine on 32-bit systems, but on 64-bit\nsystems you may run into trouble if you frequently passed \nPyArray_FromDims the dimensions member of the old PyArrayObject structure\nbecause sizeof(intp) != sizeof(int).\n\n\nGetting an arrayobject from an arbitrary Python object\n==============================================================\n\nPyArray_FromAny(...)\n\nThis function replaces PyArray_ContiguousFromObject and friends (those\nfunction calls still remain but they are loose wrappers around the\nPyArray_FromAny call).\n\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n\n\nop        : The Python object to \"convert\" to an array object\n\ntypecode  : A typecode structure filled with the data type and\n              itemsize of the desired data type.  This can be NULL, if\n              the type should be determined from the object.  Unless\n              FORCECAST is present in flags, this call will generate\n              an error if the data type cannot be safely obtained from\n              the object.\n\nmin_depth : The minimum depth of array needed or 0 if doesn't matter\n\nmax_depth : The maximum depth of array allowed or 0 if doesn't matter\n\nrequires  : A flag indicating the \"requirements\" of the returned array. \n\n\nFrom the code comments, the requires flag is explained.\n\nrequires can be any of \n\n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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 to guarantee CONTIGUOUS, ALIGNED, NOTSWAPPED, \n   and WRITEABLE and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, if the object is an array and requires is 0, \n   the array will just be INCREF'd and returned. \n   \n   typecode->fortran can be set to request a\n   fortran-contiguous  array (or just | FORTRAN to the requires flags).\n   Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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.  This is useful, \n   if you don't want to deal with a possibly mis-behaved array, but want\n   to update it easily using a local contiguous copy. \n\n   FORCECAST will cause a cast to occur regardless of whether or not\n   it is safe. \n\n\nPyArray_Typecode structure\n{\n        int type_num;\n        int itemsize;\n        int fortran --- used to indicate a fortran array is desired.\n}\n\n\nPyArray_ContiguousFromAny(op, typenum, min_depth, max_depth) is equivalent\nto PyArray_ContiguousFromObject(...) (which is still available), except\nit will return the subclass if op is already a subclass of the ndarray.  \nThe ContiguousFromObject version will always return an ndarray (or a bigndarray). \n\nPassing Data Type information to C-code\n============================================\n\nTo get a Typecode structure from Python use the\nPyArray_TypecodeConverter function.  This will return a typecode\nstructure filled appropriately based on a wide variety of user inputs.\n\nSee the arraymethods.c and multiarraymodule.c files for many examples of usage.\n\n\nGetting at the structure of the array.\n\nYou should use the #defines provided to access array structure portions:\n\nPyArray_DATA(obj)\nPyArray_ITEMSIZE(obj)\nPyArray_NDIM(obj)\nPyArray_DIMS(obj)\nPyArray_DIM(obj, n)\nPyArray_STRIDES(obj)\nPyArray_STRIDE(obj,n)\n\n\nsee more in arrayobject.h\n\n\n\nNDArray Flags\n==========================\n\nThe flags attribute of the PyArrayObject structure contains important \ninformation about the memory used by the array (pointed to by the data member)\nThis flags information must be kept accurate or strange results and even\nsegfaults may result. \n\nThere are 7 (binary) flags that describe the memory area used by the\ndata buffer.  These constants are defined in arrayobject.h and\ndetermine the bit-position of the flag.  Python exposes a nice dictionary\ninterface for getting (and sometimes setting) these flags.\n\nMemory areas of all kinds can be pointed to by an NDArray, necessitating \nthese flags.  If you get a PyArrayObject in C-code, \nyou should be aware of the flags that are set.  \nIf you need to guarantee a certain kind of array \n(like CONTIGUOUS and BEHAVED), then pass these requirements into the \nPyArray_FromAny function.  \n\n\nCONTIGUOUS  :  True if the array is a (C-style) contiguous in memory.\nFORTRAN     :  True if the array is (Fortran-style) contiguous in memory.\n\nNotice that 1-d arrays are always both FORTRAN contiguous and C contiguous.\nBoth of these flags can be checked and are convenience flags.\n\nOWNDATA     :  True if the array owns the memory (it will try and free it\n\t        using PyDataMem_FREE() on deallocation --- \n\t\tso it better really own it).\n\nThese three flags facilitate using a data pointer that is a memory-mapped\narray, or part of some larger record array.  But, they may have other uses...\n\nALIGNED     :  True if the data buffer is aligned for the type.  This\n\t        can be checked.\nNOTSWAPPED  :  True if the data is in machine byte order.  Arrays\n\t        can be out of machine byte order and will still \n\t\twork (albeit more slowly).  \nWRITEABLE   :  True only if the data buffer can be \"written\" to.\n\n\nUPDATEIFCOPY :  This is a special flag that is set if this array represents\n\t          a copy made because a user required certain FLAGS in \n\t\t  PyArray_FromAny  and a copy had to be made of some \n\t\t  other array.   The base attribute then points to the \n\t\t  \"misbehaved\" array.  When the array with this flag\n                  set is deallocated, it will copy its contents to\n\t          the \"misbehaved\" array (casting if necessary).\n\n\nPyArray_UpdateFlags(obj, FLAGS) will update the obj->flags for FLAGS\n                  which can be any of CONTIGUOUS FORTRAN or ALIGNED.\n\nSome useful combinations of these flags:\n\nBEHAVED = ALIGNED | NOTSWAPPED | WRITEABLE\nBEHAVED_RO = ALIGNED | NOTSWAPPED\nCARRAY_FLAGS = CONTIGUOUS | BEHAVED\nFARRAY_FLAGS = FORTRAN | BEHAVED\n\n\nThe macro PyArray_CHECKFLAGS(obj, FLAGS)  can test any combination of flags.\nThere are several default combinations defined as macros already \n(see arrayobject.h) \n\n\n\n\n\nThere are more C-API enhancements which you can discover in the code, \n      or buy the book (http://www.trelgol.com)\n\n\n",
                "source_code_before": "Author:          Travis Oliphant\nDiscussions to:  scipy-dev@scipy.org\nCreated:         October 2005\n\nThe CAPI of SciPy is (mostly) backward compatible with Numeric.  \n\nThere are a few non-standard Numeric usages (that were not really part\nof the API) that will need to be changed:\n\n  * If you used any of the function pointers in the PyArray_Descr\n    structure you will have to modify your usage of those.  The\n    casting functions have eliminated the strides argument (use\n    PyArray_CastTo if you need strided casting). All functions have\n    one or two PyArrayObject * arguments at the end.  This allows the\n    flexible arrays and mis-behaved arrays to be handled.\n\n  * The descr->zero and descr->one constants have been replaced with\n    function calls, PyArray_Zero, and PyArray_One.\n\n  * You should use PyArray_ITEMSIZE(obj) instead of descr->elsize to\n    get the itemsize of an object (for flexible arrays descr->elsize\n    is 0).\n\n  * If you passed array->dimensions and array->strides around to \n    functions.  These are now, intp* pointers.  On 32-bit systems\n    there won't be a problem.  However, on 64-bit systems, you will\n    need to make changes.  \n\n\nThe header files arrayobject.h and ufuncobject.h contain many defines\nthat you may find useful.  The files __ufunc_api.h and\n__multiarray_api.h contain the available C-API function calls with\ntheir function signatures.\n\nAll of these headers are installed to \n\n<YOUR_PYTHON_LOCATION>/site-packages/scipy/base/include\n\n\nGetting arrays in C-code\n=========================\n\nAll new arrays can be created using PyArray_New.  A simple interface \nequivalent to PyArray_FromDims is PyArray_SimpleNew(nd, dims, typenum)\n\nThis is a very flexible function.  \n\nPyObject * PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type, \n         intp *strides, char *data, int itemsize, int flags, \n         PyObject *obj);\n\n\nsubtype  : The subtype that should be created (either pass in\n             &PyArray_Type, &PyBigArray_Type, or obj->ob_type,\n             where obj is a subtype (or subclass) of \n\t     of PyArray_Type or PyBigArray_Type).\n\nnd       : The number of dimensions (<MAX_DIMS)\n\n*dims    : A pointer to the size in each dimension.  Information will be\n             copied from here.\n\ntype     : An integer specifying the type of the array \n             (use the PyArray_XXXX enumerated types).\n\n*strides : The strides this array should have.  For new arrays created\n             by this routine, this should be NULL.  If you pass in\n             memory for this array to use, then you should pass in the\n             strides information as well.  Any strides will be copied into\n\t     the array structure.   Do not pass in bad strides information.\n\n\t    PyArray_CheckStrides(...) can help but you must call it if you are\n\t     unsure.\n\n*data    : NULL for creating brand-new memory.  If you want this array\n             to wrap another memory area, then pass the pointer here.\n             You are responsible for deleting the memory in that case,\n             but do not do so until the new array object has been\n             deleted.  The best way to handle that is to get the memory\n             from another Python object, INCREF that Python object after\n             passing it's data pointer to this routine, and set the\n             ->base member of the returned array to the Python object.\n             You are responsible for setting the base object.  Failure\n             to do so will create a memory leak.  \n            \n            If you pass in a data buffer, the flags argument will be\n              the flags of the new array. If you create a new array, a\n              non-zero flags argument indicates that you want the array\n              to be in FORTRAN order.\n\nitemsize : Indicates the itemsize for the new array.  This can be 0\n             if it is a fixed-size array type.  It is only used for\n             flexible array types and must be set in that case.\n\n\nflags    : Either the flags showing how to interpret the data buffer\n             passed in.  Or if a new array is created, nonzero to\n             indicate a FORTRAN order array.  See below for an explanation of\n\t     the flags.\n\n\nobj      : If subtypes is &PyArray_Type or &PyBigArray_Type, this\n             argument is ignored.  Otherwise, the __array_finalize__\n             method of the subtype is called (if present) and passed\n             this object.  This is usually an array of the type to be\n             created (so the __array_finalize__ method must handle an\n             array argument.  But, it can be anything...)\n\nNote: The returned array object will be unitialized unless the type is\nPyArray_OBJECT.\n\nPyArray_SimpleNew(nd, dims, typenum)  is a drop-in replacement for \nPyArray_FromDims (except it takes intp* dims instead of int* dims which\n\t\t  matters on 64-bit systems).\n\nPyArray_SimpleNew is just a macro for PyArray_New with default arguments.\n\n\nThe PyArray_FromDims and family of functions are still available and\nare loose wrappers around this function.  These functions still take\nint * arguments.  This should be fine on 32-bit systems, but on 64-bit\nsystems you may run into trouble if you frequently passed \nPyArray_FromDims the dimensions member of the old PyArrayObject structure\nbecause sizeof(intp) != sizeof(int).\n\n\nGetting an arrayobject from an arbitrary Python object\n==============================================================\n\nPyArray_FromAny(...)\n\nThis function replaces PyArray_ContiguousFromObject and friends (those\nfunction calls still remain but they are loose wrappers around the\nPyArray_FromAny call).\n\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n\n\nop        : The Python object to \"convert\" to an array object\n\ntypecode  : A typecode structure filled with the data type and\n              itemsize of the desired data type.  This can be NULL, if\n              the type should be determined from the object.  Unless\n              FORCECAST is present in flags, this call will generate\n              an error if the data type cannot be safely obtained from\n              the object.\n\nmin_depth : The minimum depth of array needed or 0 if doesn't matter\n\nmax_depth : The maximum depth of array allowed or 0 if doesn't matter\n\nrequires  : A flag indicating the \"requirements\" of the returned array. \n\n\nFrom the code comments, the requires flag is explained.\n\nrequires can be any of \n\n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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 to guarantee CONTIGUOUS, ALIGNED, NOTSWAPPED, \n   and WRITEABLE and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, if the object is an array and requires is 0, \n   the array will just be INCREF'd and returned. \n   \n   typecode->fortran can be set to request a\n   fortran-contiguous  array (or just | FORTRAN to the requires flags).\n   Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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.  This is useful, \n   if you don't want to deal with a possibly mis-behaved array, but want\n   to update it easily using a local contiguous copy. \n\n   FORCECAST will cause a cast to occur regardless of whether or not\n   it is safe. \n\n\nPyArray_Typecode structure\n{\n        int type_num;\n        int itemsize;\n        int fortran --- used to indicate a fortran array is desired.\n}\n\n\nPassing Data Type information to C-code\n============================================\n\nTo get a Typecode structure from Python use the\nPyArray_TypecodeConverter function.  This will return a typecode\nstructure filled appropriately based on a wide variety of user inputs.\n\nSee the arraymethods.c and multiarraymodule.c files for many examples of usage.\n\n\nGetting at the structure of the array.\n\nYou should use the #defines provided to access array structure portions:\n\nPyArray_DATA(obj)\nPyArray_ITEMSIZE(obj)\nPyArray_NDIM(obj)\nPyArray_DIMS(obj)\nPyArray_DIM(obj, n)\nPyArray_STRIDES(obj)\nPyArray_STRIDE(obj,n)\n\n\nsee more in arrayobject.h\n\n\n\nNDArray Flags\n==========================\n\nThe flags attribute of the PyArrayObject structure contains important \ninformation about the memory used by the array (pointed to by the data member)\nThis flags information must be kept accurate or strange results and even\nsegfaults may result. \n\nThere are 7 (binary) flags that describe the memory area used by the\ndata buffer.  These constants are defined in arrayobject.h and\ndetermine the bit-position of the flag.  Python exposes a nice dictionary\ninterface for getting (and sometimes setting) these flags.\n\nMemory areas of all kinds can be pointed to by an NDArray, necessitating \nthese flags.  If you get a PyArrayObject in C-code, \nyou should be aware of the flags that are set.  \nIf you need to guarantee a certain kind of array \n(like CONTIGUOUS and BEHAVED), then pass these requirements into the \nPyArray_FromAny function.  \n\n\nCONTIGUOUS  :  True if the array is a (C-style) contiguous in memory.\nFORTRAN     :  True if the array is (Fortran-style) contiguous in memory.\n\nNotice that 1-d arrays are always both FORTRAN contiguous and C contiguous.\nBoth of these flags can be checked and are convenience flags.\n\nOWNDATA     :  True if the array owns the memory (it will try and free it\n\t        using PyDataMem_FREE() on deallocation --- \n\t\tso it better really own it).\n\nThese three flags facilitate using a data pointer that is a memory-mapped\narray, or part of some larger record array.  But, they may have other uses...\n\nALIGNED     :  True if the data buffer is aligned for the type.  This\n\t        can be checked.\nNOTSWAPPED  :  True if the data is in machine byte order.  Arrays\n\t        can be out of machine byte order and will still \n\t\twork (albeit more slowly).  \nWRITEABLE   :  True only if the data buffer can be \"written\" to.\n\n\nUPDATEIFCOPY :  This is a special flag that is set if this array represents\n\t          a copy made because a user required certain FLAGS in \n\t\t  PyArray_FromAny  and a copy had to be made of some \n\t\t  other array.   The base attribute then points to the \n\t\t  \"misbehaved\" array.  When the array with this flag\n                  set is deallocated, it will copy its contents to\n\t          the \"misbehaved\" array (casting if necessary).\n\n\nPyArray_UpdateFlags(obj, FLAGS) will update the obj->flags for FLAGS\n                  which can be any of CONTIGUOUS FORTRAN or ALIGNED.\n\nSome useful combinations of these flags:\n\nBEHAVED = ALIGNED | NOTSWAPPED | WRITEABLE\nBEHAVED_RO = ALIGNED | NOTSWAPPED\nCARRAY_FLAGS = CONTIGUOUS | BEHAVED\nFARRAY_FLAGS = FORTRAN | BEHAVED\n\n\nThe macro PyArray_CHECKFLAGS(obj, FLAGS)  can test any combination of flags.\nThere are several default combinations defined as macros already \n(see arrayobject.h) \n\n\n\n\n\nThere are more C-API enhancements which you can discover in the code, \n      or buy the book (http://www.trelgol.com)\n\n\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [
                        "PyArray_ContiguousFromAny(op, typenum, min_depth, max_depth) is equivalent",
                        "to PyArray_ContiguousFromObject(...) (which is still available), except",
                        "it will return the subclass if op is already a subclass of the ndarray.",
                        "The ContiguousFromObject version will always return an ndarray (or a bigndarray).",
                        ""
                    ],
                    "deleted": []
                }
            }
        ]
    },
    {
        "hash": "0282cf783893d0bf8908120a1995af51eabb361b",
        "msg": "Removed mapiter from Python exposure.",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-14T07:30:24+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T07:30:24+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "366fab195fb063e243b54994df6bb4b30b707f8c"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 10,
        "insertions": 24,
        "lines": 34,
        "files": 3,
        "dmm_unit_size": 0.14285714285714285,
        "dmm_unit_complexity": 0.14285714285714285,
        "dmm_unit_interfacing": 0.0,
        "modified_files": [
            {
                "old_path": "scipy/base/numeric.py",
                "new_path": "scipy/base/numeric.py",
                "filename": "numeric.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -12,6 +12,7 @@\n \n ndarray = multiarray.ndarray\n bigndarray = multiarray.bigndarray\n+flatiter = multiarray.flatiter\n ufunc = type(sin)\n \n arange = multiarray.arange\n",
                "added_lines": 1,
                "deleted_lines": 0,
                "source_code": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nflatiter = multiarray.flatiter\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None, fortran=False):\n    \"\"\"returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran)\n\ndef asanyarray(a, dtype=None,copy=0,fortran=False):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asarray(a)\n   b = asarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asarray(a), axisa)\n    b = _move_axis_to_0(asarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "source_code_before": "\nimport sys\nimport types, math\n\nimport multiarray\nimport umath\nfrom umath import *\nfrom numerictypes import *\nfrom _compiled_base import _insert\n\nnewaxis = None\n\nndarray = multiarray.ndarray\nbigndarray = multiarray.bigndarray\nufunc = type(sin)\n\narange = multiarray.arange\narray = multiarray.array\nzeros = multiarray.zeros\nempty = multiarray.empty\nfromstring = multiarray.fromstring\nfromfile = multiarray.fromfile\nfrombuffer = multiarray.frombuffer\nwhere = multiarray.where\nconcatenate = multiarray.concatenate\nfastCopyAndTranspose = multiarray._fastCopyAndTranspose\nregister_dtype = multiarray.register_dtype\ncan_cast = multiarray.can_cast\n\ndef asarray(a, dtype=None, fortran=False):\n    \"\"\"returns a as an array.  Unlike array(),\n    no copy is performed if a is already an array.  Subclasses are converted\n    to base class ndarray.\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran)\n\ndef asanyarray(a, dtype=None,copy=0,fortran=False):\n    \"\"\"will pass subclasses through...\n    \"\"\"\n    return array(a, dtype, copy=0, fortran=fortran, subok=1)\n\ndef isfortran(a):\n    return a.flags['FNC']\n\n# from Fernando Perez's IPython\ndef zeros_like(a):\n    \"\"\"Return an array of zeros of the shape and typecode of a.\n\n    If you don't explicitly need the array to be zeroed, you should instead\n    use empty_like(), which is faster as it only allocates memory.\"\"\"\n    \n    a = asanyarray(a)\n    return a.__array_wrap__(zeros(a.shape,a.dtype, a.flags['FNC']))\n\ndef empty_like(a):\n    \"\"\"Return an empty (uninitialized) array of the shape and typecode of a.\n\n    Note that this does NOT initialize the returned array.  If you require\n    your array to be initialized, you should use zeros_like().\n\n    \"\"\"\n    a = asanyarray(a)\n    return a.__array_wrap__(empty(a.shape,a.dtype, a.flags['FNC']))\n\n# end Fernando's utilities\n\n_mode_from_name_dict = {'v': 0,\n                        's' : 1,\n                        'f' : 2}\n\ndef _mode_from_name(mode):\n    if isinstance(mode, type(\"\")):\n        return _mode_from_name_dict[mode.lower()[0]]\n    return mode\n        \ndef correlate(a,v,mode='valid'):\n    mode = _mode_from_name(mode)\n    return multiarray.correlate(a,v,mode)\n\n\ndef convolve(a,v,mode='full'):\n    \"\"\"Returns the discrete, linear convolution of 1-D\n    sequences a and v; mode can be 0 (valid), 1 (same), or 2 (full)\n    to specify size of the resulting sequence.\n    \"\"\"\n    if (len(v) > len(a)):\n        a, v = v, a\n    mode = _mode_from_name(mode)\n    return correlate(a,asarray(v)[::-1],mode)\n\n\ninner = multiarray.inner\ndot = multiarray.dot\n\ndef outer(a,b):\n   \"\"\"outer(a,b) returns the outer product of two vectors.\n      result(i,j) = a(i)*b(j) when a and b are vectors\n      Will accept any arguments that can be made into vectors.\n   \"\"\"\n   a = asarray(a)\n   b = asarray(b)\n   return a.ravel()[:,newaxis]*b.ravel()[newaxis,:]\n\ndef vdot(a, b):\n    \"\"\"Returns the dot product of 2 vectors (or anything that can be made into\n       a vector). NB: this is not the same as `dot`, as it takes the conjugate\n       of its first argument if complex and always returns a scalar.\"\"\"\n    return dot(asarray(a).ravel().conj(), asarray(b).ravel())\n\n# try to import blas optimized dot if available\ntry:\n    # importing this changes the dot function for basic 4 types\n    # to blas-optimized versions.\n    from scipy.lib._dotblas import dot, vdot, inner, alterdot, restoredot\nexcept ImportError:\n    def alterdot():\n        pass\n    def restoredot():\n        pass\n\n\ndef _move_axis_to_0(a, axis):\n    if axis == 0:\n        return a\n    n = a.ndim\n    if axis < 0:\n        axis += n\n    axes = range(1, axis+1) + [0,] + range(axis+1, n)\n    return a.transpose(axes)\n\ndef cross(a, b, axisa=-1, axisb=-1, axisc=-1):\n    \"\"\"Return the cross product of two (arrays of) vectors.\n\n    The cross product is performed over the last axis of a and b by default,\n    and can handle axes with dimensions 2 and 3. For a dimension of 2,\n    the z-component of the equivalent three-dimensional cross product is\n    returned.\n    \"\"\"\n    a = _move_axis_to_0(asarray(a), axisa)\n    b = _move_axis_to_0(asarray(b), axisb)\n    msg = \"incompatible dimensions for cross product\\n\"\\\n          \"(dimension must be 2 or 3)\"\n    if (a.shape[0] not in [2,3]) or (b.shape[0] not in [2,3]):\n        raise ValueError(msg)\n    if a.shape[0] == 2:\n        if (b.shape[0] == 2):\n            cp = a[0]*b[1] - a[1]*b[0]\n            if cp.ndim == 0:\n                return cp\n            else:\n                return cp.swapaxes(0,axisc)\n        else:\n            x = a[1]*b[2]\n            y = -a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n    elif a.shape[0] == 3:\n        if (b.shape[0] == 3):\n            x = a[1]*b[2] - a[2]*b[1]\n            y = a[2]*b[0] - a[0]*b[2]\n            z = a[0]*b[1] - a[1]*b[0]\n        else:\n            x = -a[2]*b[1]\n            y = a[2]*b[0]\n            z = a[0]*b[1] - a[1]*b[0]\n    cp = array([x,y,z])\n    if cp.ndim == 1:\n        return cp\n    else:\n        return cp.swapaxes(0,axisc)\n    \n\n#Use numarray's printing function\nfrom arrayprint import array2string, get_printoptions, set_printoptions\n\n_typelessdata = [int_, float_, complex_]\nif issubclass(intc, int):\n    _typelessdata.append(intc)\n\nif issubclass(longlong, int):\n    _typelessdata.append(longlong)\n\ndef array_repr(arr, max_line_width=None, precision=None, suppress_small=None):\n    if arr.size > 0 or arr.shape==(0,):\n        lst = array2string(arr, max_line_width, precision, suppress_small,\n                           ', ', \"array(\")\n    else: # show zero-length shape unless it is (0,)\n        lst = \"[], shape=%s\" % (repr(arr.shape),)\n    typeless = arr.dtype in _typelessdata\n\n    if arr.__class__ is not ndarray:\n        cName= arr.__class__.__name__\n    else:\n        cName = \"array\"\n    if typeless and arr.size:\n        return cName + \"(%s)\" % lst\n    else:\n        typename=arr.dtype.__name__[:-8]\n        return cName + \"(%s, dtype=%s)\" % (lst, typename)\n\ndef array_str(a, max_line_width = None, precision = None, suppress_small = None):\n    return array2string(a, max_line_width, precision, suppress_small, ' ', \"\")\n\nset_string_function = multiarray.set_string_function\nset_string_function(array_str, 0)\nset_string_function(array_repr, 1)\n\n\nlittle_endian = (sys.byteorder == 'little')\n\ndef indices(dimensions, dtype=int_):\n    \"\"\"indices(dimensions,dtype=int_) returns an array representing a grid\n    of indices with row-only, and column-only variation.\n    \"\"\"\n    tmp = ones(dimensions, dtype)\n    lst = []\n    for i in range(len(dimensions)):\n        lst.append( add.accumulate(tmp, i, )-1 )\n    return array(lst)\n\ndef fromfunction(function, dimensions, **kwargs):\n    \"\"\"fromfunction(function, dimensions) returns an array constructed by\n    calling function on a tuple of number grids.  The function should\n    accept as many arguments as there are dimensions which is a list of\n    numbers indicating the length of the desired output for each axis.\n\n    The function can also accept keyword arguments which will be\n    passed in as well. \n    \"\"\"\n    args = indices(dimensions)\n    return function(*args,**kwargs)\n    \n\nfrom cPickle import load, loads\n_cload = load\n_file = file\n\ndef load(file):\n    if isinstance(file, type(\"\")):\n        file = _file(file,\"rb\")\n    return _cload(file)\n\n\n# These are all essentially abbreviations\n# These might wind up in a special abbreviations module\n\ndef ones(shape, dtype=int_, fortran=0):\n    \"\"\"ones(shape, dtype=int_) returns an array of the given\n    dimensions which is initialized to all ones. \n    \"\"\"\n    a=zeros(shape, dtype, fortran)\n    a+=1\n    ### a[...]=1  -- slower?\n    return a\n \ndef identity(n,dtype=int_):\n    \"\"\"identity(n) returns the identity matrix of shape n x n.\n    \"\"\"\n    a = array([1]+n*[0],dtype=dtype)\n    b = empty((n,n),dtype=dtype)\n    b.flat = a\n    return b\n\ndef allclose (a, b, rtol=1.e-5, atol=1.e-8):\n    \"\"\" allclose(a,b,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        The relative error rtol must be positive and << 1.0\n        The absolute error atol comes into play for those elements\n        of y that are very small or zero; it says how small x must be also.\n    \"\"\"\n    x = array(a, copy=0)\n    y = array(b, copy=0)\n    d = less(absolute(x-y), atol + rtol * absolute(y))\n    return alltrue(ravel(d))\n            \n\n_errdict = {\"ignore\":ERR_IGNORE,\n            \"warn\":ERR_WARN,\n            \"raise\":ERR_RAISE,\n            \"call\":ERR_CALL}\n\n_errdict_rev = {}\nfor key in _errdict.keys():\n    _errdict_rev[_errdict[key]] = key\ndel key\n\ndef seterr(divide=\"ignore\", over=\"ignore\", under=\"ignore\", invalid=\"ignore\", where=0):\n    maskvalue = (_errdict[divide] << SHIFT_DIVIDEBYZERO) + \\\n                (_errdict[over] << SHIFT_OVERFLOW ) + \\\n                (_errdict[under] << SHIFT_UNDERFLOW) + \\\n                (_errdict[invalid] << SHIFT_INVALID)\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where==0 or wh == 'l':\n        frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_ERRMASK_NAME] = maskvalue\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\n    frame.f_locals[UFUNC_ERRMASK_NAME] = maskvalue\n    return\n\nseterr()\n\ndef geterr():\n    frame = sys._getframe().f_back\n    try:\n        maskvalue = frame.f_locals[UFUNC_ERRMASK_NAME]\n    except KeyError:\n        maskvalue = ERR_DEFAULT\n\n    mask = 3\n    res = {}\n    val = (maskvalue >> SHIFT_DIVIDEBYZERO) & mask\n    res['divide'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_OVERFLOW) & mask\n    res['over'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_UNDERFLOW) & mask\n    res['under'] = _errdict_rev[val]\n    val = (maskvalue >> SHIFT_INVALID) & mask\n    res['invalid'] = _errdict_rev[val]\n    return res\n\ndef setbufsize(size, where=0):\n    if size > 10e6:\n        raise ValueError, \"Very big buffers.. %s\" % size\n    frame = sys._getframe().f_back\n    try:\n        wh = where.lower()[0]\n    except (AttributeError, TypeError, IndexError):\n        wh = None\n    if where == 0 or wh == 'l':\n        frame.f_locals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 1 or wh == 'g':\n        frame.f_globals[UFUNC_BUFSIZE_NAME] = size\n    elif where == 2 or wh == 'b':\n        frame.f_builtins[UFUNC_BUFSIZE_NAME] = size\n    return\n\nsetbufsize(10000, 1)\n\ndef getbufsize(size):\n    frame = sys._getframe().f_back\n    try:\n        retval = frame.f_locals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_globals[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retval = frame.f_builtins[UFUNC_BUFSIZE_NAME]\n    except KeyError:\n        retvalue = UFUNC_BUFSIZE_DEFAULT\n\n    return retval\n\n\n# Set the UFUNC_BUFSIZE_NAME to something\n# Set the UFUNC_ERRMASK_NAME to something\nseterr(where='builtin')\nsetbufsize(UFUNC_BUFSIZE_DEFAULT,where='builtin')\n\nInf = inf = infty = Infinity = PINF\nnan = NaN = NAN\nfrom oldnumeric import *\n\n\n",
                "methods": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "a",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 31,
                        "end_line": 36,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None , copy = 0 , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 37,
                        "parameters": [
                            "a",
                            "dtype",
                            "copy",
                            "fortran"
                        ],
                        "start_line": 38,
                        "end_line": 41,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 43,
                        "end_line": 44,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 47,
                        "end_line": 54,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 56,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 72,
                        "end_line": 75,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 77,
                        "end_line": 79,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 82,
                        "end_line": 90,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 96,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 105,
                        "end_line": 109,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 117,
                        "end_line": 118,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 119,
                        "end_line": 120,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 123,
                        "end_line": 130,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 132,
                        "end_line": 170,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 183,
                        "end_line": 199,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 201,
                        "end_line": 202,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 211,
                        "end_line": 219,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 221,
                        "end_line": 231,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 238,
                        "end_line": 241,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 247,
                        "end_line": 254,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 256,
                        "end_line": 262,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 264,
                        "end_line": 275,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 288,
                        "end_line": 307,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 311,
                        "end_line": 328,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 330,
                        "end_line": 344,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 348,
                        "end_line": 359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "asarray",
                        "long_name": "asarray( a , dtype = None , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "a",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 30,
                        "end_line": 35,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "asanyarray",
                        "long_name": "asanyarray( a , dtype = None , copy = 0 , fortran = False )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 37,
                        "parameters": [
                            "a",
                            "dtype",
                            "copy",
                            "fortran"
                        ],
                        "start_line": 37,
                        "end_line": 40,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "isfortran",
                        "long_name": "isfortran( a )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 12,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 42,
                        "end_line": 43,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "zeros_like",
                        "long_name": "zeros_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 46,
                        "end_line": 53,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "empty_like",
                        "long_name": "empty_like( a )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 35,
                        "parameters": [
                            "a"
                        ],
                        "start_line": 55,
                        "end_line": 63,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_mode_from_name",
                        "long_name": "_mode_from_name( mode )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "mode"
                        ],
                        "start_line": 71,
                        "end_line": 74,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "correlate",
                        "long_name": "correlate( a , v , mode = 'valid' )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 76,
                        "end_line": 78,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 3,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "convolve",
                        "long_name": "convolve( a , v , mode = 'full' )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 55,
                        "parameters": [
                            "a",
                            "v",
                            "mode"
                        ],
                        "start_line": 81,
                        "end_line": 89,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "outer",
                        "long_name": "outer( a , b )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 42,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 95,
                        "end_line": 102,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "vdot",
                        "long_name": "vdot( a , b )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 33,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 104,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "alterdot",
                        "long_name": "alterdot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 116,
                        "end_line": 117,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "restoredot",
                        "long_name": "restoredot( )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 5,
                        "parameters": [],
                        "start_line": 118,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_move_axis_to_0",
                        "long_name": "_move_axis_to_0( a , axis )",
                        "filename": "numeric.py",
                        "nloc": 8,
                        "complexity": 3,
                        "token_count": 58,
                        "parameters": [
                            "a",
                            "axis"
                        ],
                        "start_line": 122,
                        "end_line": 129,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "cross",
                        "long_name": "cross( a , b , axisa = - 1 , axisb = - 1 , axisc = - 1 )",
                        "filename": "numeric.py",
                        "nloc": 32,
                        "complexity": 9,
                        "token_count": 360,
                        "parameters": [
                            "a",
                            "b",
                            "axisa",
                            "axisb",
                            "axisc"
                        ],
                        "start_line": 131,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_repr",
                        "long_name": "array_repr( arr , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 128,
                        "parameters": [
                            "arr",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 182,
                        "end_line": 198,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_str",
                        "long_name": "array_str( a , max_line_width = None , precision = None , suppress_small = None )",
                        "filename": "numeric.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 32,
                        "parameters": [
                            "a",
                            "max_line_width",
                            "precision",
                            "suppress_small"
                        ],
                        "start_line": 200,
                        "end_line": 201,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "indices",
                        "long_name": "indices( dimensions , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 54,
                        "parameters": [
                            "dimensions",
                            "dtype"
                        ],
                        "start_line": 210,
                        "end_line": 218,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "fromfunction",
                        "long_name": "fromfunction( function , dimensions , ** kwargs )",
                        "filename": "numeric.py",
                        "nloc": 3,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "function",
                            "dimensions",
                            "kwargs"
                        ],
                        "start_line": 220,
                        "end_line": 230,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "load",
                        "long_name": "load( file )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 29,
                        "parameters": [
                            "file"
                        ],
                        "start_line": 237,
                        "end_line": 240,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "ones",
                        "long_name": "ones( shape , dtype = int_ , fortran = 0 )",
                        "filename": "numeric.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "shape",
                            "dtype",
                            "fortran"
                        ],
                        "start_line": 246,
                        "end_line": 253,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "identity",
                        "long_name": "identity( n , dtype = int_ )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "n",
                            "dtype"
                        ],
                        "start_line": 255,
                        "end_line": 261,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "allclose",
                        "long_name": "allclose( a , b , rtol = 1 . e - 5 , atol = 1 . e - 8 )",
                        "filename": "numeric.py",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "a",
                            "b",
                            "rtol",
                            "atol"
                        ],
                        "start_line": 263,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "seterr",
                        "long_name": "seterr( divide = \"ignore\" , over = \"ignore\" , under = \"ignore\" , invalid = \"ignore\" , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 19,
                        "complexity": 8,
                        "token_count": 161,
                        "parameters": [
                            "divide",
                            "over",
                            "under",
                            "invalid",
                            "where"
                        ],
                        "start_line": 287,
                        "end_line": 306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "geterr",
                        "long_name": "geterr( )",
                        "filename": "numeric.py",
                        "nloc": 17,
                        "complexity": 2,
                        "token_count": 114,
                        "parameters": [],
                        "start_line": 310,
                        "end_line": 327,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "setbufsize",
                        "long_name": "setbufsize( size , where = 0 )",
                        "filename": "numeric.py",
                        "nloc": 15,
                        "complexity": 9,
                        "token_count": 105,
                        "parameters": [
                            "size",
                            "where"
                        ],
                        "start_line": 329,
                        "end_line": 343,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "getbufsize",
                        "long_name": "getbufsize( size )",
                        "filename": "numeric.py",
                        "nloc": 11,
                        "complexity": 4,
                        "token_count": 54,
                        "parameters": [
                            "size"
                        ],
                        "start_line": 347,
                        "end_line": 358,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [],
                "nloc": 241,
                "complexity": 64,
                "token_count": 1962,
                "diff_parsed": {
                    "added": [
                        "flatiter = multiarray.flatiter"
                    ],
                    "deleted": []
                }
            },
            {
                "old_path": "scipy/base/src/arrayobject.c",
                "new_path": "scipy/base/src/arrayobject.c",
                "filename": "arrayobject.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -1549,7 +1549,6 @@ PyArray_GetMap(PyArrayMapIterObject *mit)\n \tint swap;\n         PyArray_CopySwapFunc *copyswap;\n \n-\n \t/* Unbound map iterator --- Bind should have been called */\n \tif (mit->ait == NULL) return NULL;\n \n@@ -6477,6 +6476,7 @@ PyArray_MapIterReset(PyArrayMapIterObject *mit)\n \tPyArray_CopySwapFunc *copyswap;\n \n \tmit->index = 0;\n+\n \tcopyswap = mit->iters[0]->ao->descr->copyswap;\n \n \tif (mit->subspace != NULL) {\n@@ -6645,7 +6645,7 @@ PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr)\n \tcurraxis = 0;\n \tj = 0;\n \tnoellip = 1;  /* Only expand the first ellipsis */\n-\tmemset(mit->bscoord, '\\0', sizeof(intp)*arr->nd);\n+\tmemset(mit->bscoord, 0, sizeof(intp)*arr->nd);\n \tfor (i=0; i<n; i++) {\n \t\t/* We need to fill in the starting coordinates for\n \t\t   the subspace */\n@@ -6961,7 +6961,7 @@ arraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n \n \n /* Returns a 0-dim array holding the element desired */\n-\n+/*\n static PyObject *\n arraymapiter_next(PyArrayMapIterObject *mit)\n {\n@@ -6975,6 +6975,7 @@ arraymapiter_next(PyArrayMapIterObject *mit)\n \t}\n         return NULL;\n }\n+*/\n \n static void\n arraymapiter_dealloc(PyArrayMapIterObject *mit)\n@@ -7009,6 +7010,17 @@ arraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n         return 0;\n }\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 MapIterNew must be \n+   that does not work.  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 /* \n static char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n \t\"mapiter object\";\n@@ -7016,16 +7028,15 @@ static char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n static PyObject *\n mapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n {\n-\tPyObject *r;\n-        intp size, strides;\n-        int nd;\n \tPyArrayObject *arr;\n \n         if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n \n-\tPyArray_MapIterBind(mit, arr);\n+ \tPyArray_MapIterBind(mit, arr);\n \n \tif (mit->ait == NULL) return NULL;\n+\t\n+ \tPyArray_MapIterReset(mit);\n \n \tPy_INCREF(Py_None);\n \treturn Py_None;\n@@ -7067,8 +7078,8 @@ static PyTypeObject PyArrayMapIter_Type = {\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)arraymapiter_next,\t/* tp_iternext */\n-        0,\t    \t\t                /* tp_methods */\n+        (iternextfunc)0, /*arraymapiter_next,*/\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",
                "added_lines": 20,
                "deleted_lines": 9,
                "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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\nstatic PyObject *\nPyArray_ContiguousFromAny(PyObject *op, int type, int min_depth, \n\t\t\t  int max_depth)\n{\n\tPyArray_Typecode typecode = {0,0,0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS);\n}\t\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n/*\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n*/\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\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 MapIterNew must be \n   that does not work.  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 char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n \tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\t\n \tPyArray_MapIterReset(mit);\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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, /*arraymapiter_next,*/\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\nstatic PyObject *\nPyArray_ContiguousFromAny(PyObject *op, int type, int min_depth, \n\t\t\t  int max_depth)\n{\n\tPyArray_Typecode typecode = {0,0,0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS);\n}\t\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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\tcopyswap = mit->iters[0]->ao->descr->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\n\n/* \nstatic char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyObject *r;\n        intp size, strides;\n        int nd;\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n\tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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)arraymapiter_next,\t/* tp_iternext */\n        0,\t    \t\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\n\n",
                "methods": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1592,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1595,
                        "end_line": 1654,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1675,
                        "end_line": 1750,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1763,
                        "end_line": 1815,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1823,
                        "end_line": 1826,
                        "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": 1845,
                        "end_line": 1857,
                        "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": 1860,
                        "end_line": 1875,
                        "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": 1879,
                        "end_line": 1888,
                        "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": 1891,
                        "end_line": 1902,
                        "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": 1970,
                        "end_line": 2003,
                        "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": 2010,
                        "end_line": 2049,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2052,
                        "end_line": 2071,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2075,
                        "end_line": 2094,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2098,
                        "end_line": 2109,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2112,
                        "end_line": 2123,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2126,
                        "end_line": 2138,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2141,
                        "end_line": 2144,
                        "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": 2147,
                        "end_line": 2150,
                        "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": 2153,
                        "end_line": 2156,
                        "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": 2159,
                        "end_line": 2162,
                        "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": 2165,
                        "end_line": 2168,
                        "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": 2171,
                        "end_line": 2174,
                        "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": 2177,
                        "end_line": 2180,
                        "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": 2183,
                        "end_line": 2186,
                        "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": 2189,
                        "end_line": 2192,
                        "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": 2195,
                        "end_line": 2198,
                        "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": 2201,
                        "end_line": 2204,
                        "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": 2207,
                        "end_line": 2210,
                        "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": 2213,
                        "end_line": 2216,
                        "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": 2219,
                        "end_line": 2222,
                        "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": 2225,
                        "end_line": 2228,
                        "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": 2231,
                        "end_line": 2234,
                        "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": 2237,
                        "end_line": 2240,
                        "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": 2243,
                        "end_line": 2246,
                        "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": 2249,
                        "end_line": 2252,
                        "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": 2255,
                        "end_line": 2258,
                        "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": 2261,
                        "end_line": 2264,
                        "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": 2267,
                        "end_line": 2270,
                        "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": 2273,
                        "end_line": 2276,
                        "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": 2279,
                        "end_line": 2282,
                        "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": 2285,
                        "end_line": 2288,
                        "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": 2291,
                        "end_line": 2294,
                        "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": 2297,
                        "end_line": 2300,
                        "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": 2303,
                        "end_line": 2307,
                        "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": 2310,
                        "end_line": 2314,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2318,
                        "end_line": 2336,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2339,
                        "end_line": 2354,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2358,
                        "end_line": 2384,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2387,
                        "end_line": 2412,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2415,
                        "end_line": 2437,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2440,
                        "end_line": 2462,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2465,
                        "end_line": 2487,
                        "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": 2490,
                        "end_line": 2494,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2555,
                        "end_line": 2593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2597,
                        "end_line": 2618,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2621,
                        "end_line": 2626,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2647,
                        "end_line": 2694,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2697,
                        "end_line": 2733,
                        "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": 2739,
                        "end_line": 2756,
                        "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": 2759,
                        "end_line": 2771,
                        "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": 2774,
                        "end_line": 2786,
                        "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": 2790,
                        "end_line": 2867,
                        "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": 2870,
                        "end_line": 2899,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2905,
                        "end_line": 2921,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2926,
                        "end_line": 2949,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2955,
                        "end_line": 2971,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2975,
                        "end_line": 2991,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2995,
                        "end_line": 3011,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3014,
                        "end_line": 3047,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3051,
                        "end_line": 3073,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3080,
                        "end_line": 3095,
                        "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": 3115,
                        "end_line": 3139,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3143,
                        "end_line": 3286,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3291,
                        "end_line": 3396,
                        "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": 3400,
                        "end_line": 3417,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3421,
                        "end_line": 3536,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3543,
                        "end_line": 3546,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3549,
                        "end_line": 3559,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3632,
                        "end_line": 3635,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3639,
                        "end_line": 3673,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3677,
                        "end_line": 3680,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3683,
                        "end_line": 3716,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3720,
                        "end_line": 3727,
                        "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": 3730,
                        "end_line": 3738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3742,
                        "end_line": 3756,
                        "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": 3759,
                        "end_line": 3803,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3807,
                        "end_line": 3810,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3813,
                        "end_line": 3820,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3824,
                        "end_line": 3831,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3834,
                        "end_line": 3854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3857,
                        "end_line": 3879,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3882,
                        "end_line": 3885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3889,
                        "end_line": 3892,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3904,
                        "end_line": 3962,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3967,
                        "end_line": 3977,
                        "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": 3981,
                        "end_line": 4006,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4010,
                        "end_line": 4042,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4045,
                        "end_line": 4080,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4083,
                        "end_line": 4120,
                        "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": 4123,
                        "end_line": 4126,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4129,
                        "end_line": 4183,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4362,
                        "end_line": 4387,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4390,
                        "end_line": 4412,
                        "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": 4419,
                        "end_line": 4445,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4448,
                        "end_line": 4468,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4471,
                        "end_line": 4612,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4615,
                        "end_line": 4638,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4642,
                        "end_line": 4665,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4669,
                        "end_line": 4726,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4730,
                        "end_line": 4737,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4743,
                        "end_line": 4833,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4839,
                        "end_line": 4850,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4853,
                        "end_line": 4888,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4895,
                        "end_line": 4941,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4944,
                        "end_line": 5075,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5079,
                        "end_line": 5184,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5187,
                        "end_line": 5282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5285,
                        "end_line": 5306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5310,
                        "end_line": 5372,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5375,
                        "end_line": 5380,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5383,
                        "end_line": 5389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5443,
                        "end_line": 5473,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5484,
                        "end_line": 5500,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5506,
                        "end_line": 5512,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5515,
                        "end_line": 5522,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5525,
                        "end_line": 5532,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromAny",
                        "long_name": "PyArray_ContiguousFromAny( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5537,
                        "end_line": 5544,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5547,
                        "end_line": 5630,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5633,
                        "end_line": 5657,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5667,
                        "end_line": 5704,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5709,
                        "end_line": 5719,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5722,
                        "end_line": 5727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5730,
                        "end_line": 5735,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5739,
                        "end_line": 5742,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5746,
                        "end_line": 5794,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5797,
                        "end_line": 5850,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5854,
                        "end_line": 5973,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5977,
                        "end_line": 6009,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6012,
                        "end_line": 6054,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6058,
                        "end_line": 6180,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6193,
                        "end_line": 6235,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6240,
                        "end_line": 6244,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6309,
                        "end_line": 6370,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6378,
                        "end_line": 6393,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6399,
                        "end_line": 6468,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6472,
                        "end_line": 6509,
                        "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": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6515,
                        "end_line": 6559,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6577,
                        "end_line": 6713,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6719,
                        "end_line": 6788,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6791,
                        "end_line": 6924,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6930,
                        "end_line": 6960,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6981,
                        "end_line": 6990,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6993,
                        "end_line": 7011,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1596,
                        "end_line": 1655,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1676,
                        "end_line": 1751,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1764,
                        "end_line": 1816,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1824,
                        "end_line": 1827,
                        "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": 1846,
                        "end_line": 1858,
                        "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": 1861,
                        "end_line": 1876,
                        "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": 1880,
                        "end_line": 1889,
                        "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": 1892,
                        "end_line": 1903,
                        "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": 1971,
                        "end_line": 2004,
                        "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": 2011,
                        "end_line": 2050,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2053,
                        "end_line": 2072,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2076,
                        "end_line": 2095,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2099,
                        "end_line": 2110,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2113,
                        "end_line": 2124,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2127,
                        "end_line": 2139,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2142,
                        "end_line": 2145,
                        "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": 2148,
                        "end_line": 2151,
                        "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": 2154,
                        "end_line": 2157,
                        "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": 2160,
                        "end_line": 2163,
                        "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": 2166,
                        "end_line": 2169,
                        "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": 2172,
                        "end_line": 2175,
                        "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": 2178,
                        "end_line": 2181,
                        "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": 2184,
                        "end_line": 2187,
                        "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": 2190,
                        "end_line": 2193,
                        "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": 2196,
                        "end_line": 2199,
                        "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": 2202,
                        "end_line": 2205,
                        "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": 2208,
                        "end_line": 2211,
                        "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": 2214,
                        "end_line": 2217,
                        "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": 2220,
                        "end_line": 2223,
                        "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": 2226,
                        "end_line": 2229,
                        "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": 2232,
                        "end_line": 2235,
                        "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": 2238,
                        "end_line": 2241,
                        "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": 2244,
                        "end_line": 2247,
                        "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": 2250,
                        "end_line": 2253,
                        "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": 2256,
                        "end_line": 2259,
                        "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": 2262,
                        "end_line": 2265,
                        "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": 2268,
                        "end_line": 2271,
                        "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": 2274,
                        "end_line": 2277,
                        "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": 2280,
                        "end_line": 2283,
                        "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": 2286,
                        "end_line": 2289,
                        "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": 2292,
                        "end_line": 2295,
                        "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": 2298,
                        "end_line": 2301,
                        "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": 2304,
                        "end_line": 2308,
                        "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": 2311,
                        "end_line": 2315,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2319,
                        "end_line": 2337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2340,
                        "end_line": 2355,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2359,
                        "end_line": 2385,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2388,
                        "end_line": 2413,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2416,
                        "end_line": 2438,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2441,
                        "end_line": 2463,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2466,
                        "end_line": 2488,
                        "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": 2491,
                        "end_line": 2495,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2556,
                        "end_line": 2594,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2598,
                        "end_line": 2619,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2622,
                        "end_line": 2627,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2648,
                        "end_line": 2695,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2698,
                        "end_line": 2734,
                        "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": 2740,
                        "end_line": 2757,
                        "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": 2760,
                        "end_line": 2772,
                        "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": 2775,
                        "end_line": 2787,
                        "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": 2791,
                        "end_line": 2868,
                        "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": 2871,
                        "end_line": 2900,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2906,
                        "end_line": 2922,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2927,
                        "end_line": 2950,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2956,
                        "end_line": 2972,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2976,
                        "end_line": 2992,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2996,
                        "end_line": 3012,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3015,
                        "end_line": 3048,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3052,
                        "end_line": 3074,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3081,
                        "end_line": 3096,
                        "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": 3116,
                        "end_line": 3140,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3144,
                        "end_line": 3287,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3292,
                        "end_line": 3397,
                        "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": 3401,
                        "end_line": 3418,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3422,
                        "end_line": 3537,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3544,
                        "end_line": 3547,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3550,
                        "end_line": 3560,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3633,
                        "end_line": 3636,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3640,
                        "end_line": 3674,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3678,
                        "end_line": 3681,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3684,
                        "end_line": 3717,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3721,
                        "end_line": 3728,
                        "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": 3731,
                        "end_line": 3739,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3743,
                        "end_line": 3757,
                        "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": 3760,
                        "end_line": 3804,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3808,
                        "end_line": 3811,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3814,
                        "end_line": 3821,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3825,
                        "end_line": 3832,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3835,
                        "end_line": 3855,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3858,
                        "end_line": 3880,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3883,
                        "end_line": 3886,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3890,
                        "end_line": 3893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3905,
                        "end_line": 3963,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3968,
                        "end_line": 3978,
                        "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": 3982,
                        "end_line": 4007,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4011,
                        "end_line": 4043,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4046,
                        "end_line": 4081,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4084,
                        "end_line": 4121,
                        "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": 4124,
                        "end_line": 4127,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4130,
                        "end_line": 4184,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4363,
                        "end_line": 4388,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4391,
                        "end_line": 4413,
                        "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": 4420,
                        "end_line": 4446,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4449,
                        "end_line": 4469,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4472,
                        "end_line": 4613,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4616,
                        "end_line": 4639,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4643,
                        "end_line": 4666,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4670,
                        "end_line": 4727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4731,
                        "end_line": 4738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4744,
                        "end_line": 4834,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4840,
                        "end_line": 4851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4854,
                        "end_line": 4889,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4896,
                        "end_line": 4942,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4945,
                        "end_line": 5076,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5080,
                        "end_line": 5185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5188,
                        "end_line": 5283,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5286,
                        "end_line": 5307,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5311,
                        "end_line": 5373,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5376,
                        "end_line": 5381,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5384,
                        "end_line": 5390,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5444,
                        "end_line": 5474,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5485,
                        "end_line": 5501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5507,
                        "end_line": 5513,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5516,
                        "end_line": 5523,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5526,
                        "end_line": 5533,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromAny",
                        "long_name": "PyArray_ContiguousFromAny( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5538,
                        "end_line": 5545,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5548,
                        "end_line": 5631,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5634,
                        "end_line": 5658,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5668,
                        "end_line": 5705,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5710,
                        "end_line": 5720,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5723,
                        "end_line": 5728,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5731,
                        "end_line": 5736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5740,
                        "end_line": 5743,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5747,
                        "end_line": 5795,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5798,
                        "end_line": 5851,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5855,
                        "end_line": 5974,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5978,
                        "end_line": 6010,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6013,
                        "end_line": 6055,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6059,
                        "end_line": 6181,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6194,
                        "end_line": 6236,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6241,
                        "end_line": 6245,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6310,
                        "end_line": 6371,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6379,
                        "end_line": 6394,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6400,
                        "end_line": 6469,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6473,
                        "end_line": 6509,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNext",
                        "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 6,
                        "token_count": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6515,
                        "end_line": 6559,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6577,
                        "end_line": 6713,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6719,
                        "end_line": 6788,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6791,
                        "end_line": 6924,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6930,
                        "end_line": 6960,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_next",
                        "long_name": "arraymapiter_next( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 4,
                        "token_count": 70,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6966,
                        "end_line": 6977,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6980,
                        "end_line": 6989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6992,
                        "end_line": 7010,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "PyArray_MapIterReset",
                        "long_name": "PyArray_MapIterReset( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 35,
                        "complexity": 4,
                        "token_count": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6472,
                        "end_line": 6509,
                        "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": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 51,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterBind",
                        "long_name": "PyArray_MapIterBind( PyArrayMapIterObject * mit , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6577,
                        "end_line": 6713,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 5544,
                "complexity": 1217,
                "token_count": 33200,
                "diff_parsed": {
                    "added": [
                        "",
                        "\tmemset(mit->bscoord, 0, sizeof(intp)*arr->nd);",
                        "/*",
                        "*/",
                        "",
                        "/* The mapiter object must be created new each time.  It does not work",
                        "   to bind to a new array, and continue.",
                        "",
                        "   This was the orginal intention, but currently MapIterNew must be",
                        "   that does not work.  Do not expose the MapIter_Type to Python.",
                        "",
                        "   It's not very useful anyway, since mapiter(indexobj); mapiter.bind(a);",
                        "   mapiter is equivalent to a[indexobj].flat but the latter gets to use",
                        "   slice syntax.",
                        "*/",
                        " \tPyArray_MapIterBind(mit, arr);",
                        "",
                        " \tPyArray_MapIterReset(mit);",
                        "        (iternextfunc)0, /*arraymapiter_next,*/\t/* tp_iternext */",
                        "        0,             \t                        /* tp_methods */"
                    ],
                    "deleted": [
                        "",
                        "\tmemset(mit->bscoord, '\\0', sizeof(intp)*arr->nd);",
                        "",
                        "\tPyObject *r;",
                        "        intp size, strides;",
                        "        int nd;",
                        "\tPyArray_MapIterBind(mit, arr);",
                        "        (iternextfunc)arraymapiter_next,\t/* tp_iternext */",
                        "        0,\t    \t\t                /* tp_methods */"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/multiarraymodule.c",
                "new_path": "scipy/base/src/multiarraymodule.c",
                "filename": "multiarraymodule.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -4012,9 +4012,11 @@ DL_EXPORT(void) initmultiarray(void) {\n \tPyDict_SetItemString(d, \"ndarray\", (PyObject *)&PyArray_Type);\n         Py_INCREF(&PyArrayIter_Type);\n \tPyDict_SetItemString(d, \"flatiter\", (PyObject *)&PyArrayIter_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-\n+\t*/\n         set_flaginfo(d);\n \n \tif (set_typeinfo(d) == 0) \n",
                "added_lines": 3,
                "deleted_lines": 1,
                "source_code": "\n/*\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 scipy_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 <string.h>\n#include <math.h>\n*/\n\n#define _MULTIARRAYMODULE\n#include \"scipy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL;   /* Must be explicitly loaded */\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\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\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\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\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n        int i;\n        for(i=0;i<n;i++) {\n                if (l1[i] != l2[i]) return 0;\n        } \n        return 1;\n}\n\nstatic PyObject *\nPyArray_View(PyArrayObject *self, PyArray_Typecode *type)\n{\n\tPyObject *new=NULL;\n        PyObject *v=NULL;\n        int type_num = PyArray_NOTYPE;\n\n\tif (type) {\n\t\ttype_num = type->type_num;\n\t}\n\n\tnew = PyArray_New(self->ob_type,\n\t\t\t  self->nd, self->dimensions,\n\t\t\t  self->descr->type_num,\n\t\t\t  self->strides,\n\t\t\t  self->data,\n\t\t\t  self->itemsize,\n\t\t\t  self->flags, (PyObject *)self);\n\n\tif (new==NULL) return NULL;\n\t\n        Py_INCREF(self);\n        PyArray_BASE(new) = (PyObject *)self;\n        if ((type_num != PyArray_NOTYPE) &&             \\\n            (type_num != self->descr->type_num)) {\n                if (!PyTypeNum_ISFLEXIBLE(type_num)) {\n                        v = PyArray_TypeObjectFromType(type_num);\n                }\n                else {\n                        PyArray_Descr *descr;\n                        int itemsize = type->itemsize;\n                        descr = PyArray_DescrFromType(type_num);\n                        if (type_num == PyArray_UNICODE) \n                                itemsize /= sizeof(Py_UNICODE);\n                        /* construct a string representation */\n                        v = PyString_FromFormat(\"%c%d\", descr->type, \n                                                itemsize);\n                }\n                if (v == NULL) goto fail;\n                /* set attribute new.dtype = newtype */\n                if (PyObject_SetAttrString(new, \"dtype\", v) < 0) goto fail;\n                Py_DECREF(v);\n        }\n\treturn new;\t\n\n fail:\n        Py_XDECREF(v);\n        Py_XDECREF(new);\n        return NULL;\n}\n\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n        if (a->nd == 1) {\n                Py_INCREF(a);\n                return (PyObject *)a;\n        }\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) \n\t\treturn PyArray_Newshape(a, &newdim);\n\telse\n\t        return PyArray_Flatten(a, fortran);\n}\n\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tsize = PyArray_SIZE(a);\n\tret = PyArray_New(a->ob_type,\n\t\t\t  1, &size,\n\t\t\t  a->descr->type_num,\n\t\t\t  NULL,\n                          NULL,\n\t\t\t  a->itemsize,\n\t\t\t  0, (PyObject *)a);\n\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\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\n/* Returns a new array \n   with the a new shape from the data\n   in the old array\n*/\n\nstatic PyObject * \nPyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims)\n{\n        intp i, s_original, i_unknown, s_known;\n        intp *dimensions = newdims->ptr;\n        PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n        Bool same;\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<n) {\n                        if (PyArray_DIM(self,i) != dimensions[i]) \n                                same=FALSE;\n                        i++;\n                }\n                if (same) return PyArray_View(self, NULL);\n        }\n\n        if (!PyArray_ISCONTIGUOUS(self)) {\n                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"changing shape only works on contiguous arrays\");\n                return NULL;\n        }\n\t\n        s_known = 1;\n        i_unknown = -1;\n\n        for(i=0; i<n; i++) {\n                if (dimensions[i] < 0) {\n                        if (i_unknown == -1) {\n                                i_unknown = i;\n                        } else {\n                                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"can only specify one \"\t\\\n\t\t\t\t\t\t\" unknown dimension\");\n                                goto fail;\n                        }\n                } else {\n\t\t\ts_known *= dimensions[i];\n                }\n        }\n\t\n        s_original = PyArray_SIZE(self);\n\t\n        if (i_unknown >= 0) {\n                if ((s_known == 0) || (s_original % s_known != 0)) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n                dimensions[i_unknown] = s_original/s_known;\n        } else {\n                if (s_original != s_known) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n        }\n        \n\tret = (PyAO *)PyArray_New(self->ob_type,\n\t\t\t\t  n, dimensions,\n\t\t\t\t  self->descr->type_num,\n\t\t\t\t  NULL,\n\t\t\t\t  self->data,\n\t\t\t\t  self->itemsize,\n\t\t\t\t  self->flags, (PyObject *)self);\n\n\tif (ret== NULL)\n                goto fail;\n\t\n        Py_INCREF(self);\n        ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n        return (PyObject *)ret;\n\t\n fail:\n        return NULL;\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\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; i<nd; i++) {\n\t\tif (self->dimensions[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\tret = PyArray_New(self->ob_type, newnd, dimensions, \n\t\t\t  self->descr->type_num, strides,\n\t\t\t  self->data, self->itemsize, self->flags,\n\t\t\t  (PyObject *)self);\n\tself->flags &= ~OWN_DATA;\n\tself->base = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\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\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype)\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; i<n; i++) {\n\t\tif (i==axis) val = 1;\n\t\telse val = PyArray_DIM(new,i);\n\t\tPyTuple_SET_ITEM(newshape, i, PyInt_FromLong((long)val));\n\t}\n\tobj2 = PyArray_Reshape((PyAO *)obj1, newshape);\n\tPy_DECREF(obj1);\n\tPy_DECREF(newshape);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x = x - mx */\n\tobj1 = PyNumber_Subtract((PyObject *)self, obj2);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x * x */\n\tobj2 = PyNumber_Multiply(obj1, obj1);\n\tPy_DECREF(obj1);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute add.reduce(x*x,axis) */\n\tobj1 = PyArray_GenericReduceFunction((PyArrayObject *)obj2, n_ops.add,\n\t\t\t\t\t     axis, rtype);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\tn = PyArray_DIM(new,axis)-1;\n\tPy_DECREF(new);\n\tif (n==0) n=1;\n\tobj2 = PyFloat_FromDouble(1.0/((double )n));\n\tif (obj2 == NULL) {Py_DECREF(obj1); return NULL;}\n\tret = PyArray_EnsureArray(PyNumber_Multiply(obj1, obj2));\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\n\t/* sqrt() */\n\tobj1 = PyArray_GenericUnaryFunction((PyAO *)ret, n_ops.sqrt);\n\tPy_DECREF(ret);\n\n\treturn obj1;\n}\n\n\nstatic PyObject *\nPyArray_Sum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis, \n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Prod(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.multiply, axis,\n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumSum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumProd(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, \n\t\t\t\t\t\tn_ops.multiply, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Any(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_or, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_All(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_and, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Compress(PyArrayObject *self, PyObject *condition, int axis)\n{\n        PyArrayObject *cond;\n\tPyObject *res, *ret;\n\n        cond = (PyAO *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n        if (cond == NULL) return NULL;\n        \n        if (cond->nd != 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\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; i<size; i++) {\n\t\tif (self->descr->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; i<size; i++) {\n\t\t\tif (self->descr->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; j<n; j++) {\n\t\t\titem = PyArray_New(self->ob_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\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tif (item == NULL) goto fail;\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; i<size; i++) {\n\t\t\tif (self->descr->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; j<n; j++) \n\t\t\t\t\t*(dptr[j])++ = it->coordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n        \n}\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)) goto fail;\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) goto fail;\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(res1);\n\tPy_XDECREF(res2);\n\tPy_XDECREF(two);\n\tPy_XDECREF(selector);\n\treturn NULL;\n}\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_Copy(self);\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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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\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\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyObject *newaxes;\n\tint i, pos;\t\n\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 = PyTuple_New(n);\n\tif (newaxes==NULL) return NULL;\n\t/* insert at the end */\n\tPyTuple_SET_ITEM(newaxes, n-2, PyInt_FromLong((long)axis1));\n\tPyTuple_SET_ITEM(newaxes, n-1, PyInt_FromLong((long)axis2));\n\tpos = 0;\n\tfor (i=0; i<n; i++) {\n\t\tif ((i==axis1) || (i==axis2)) continue;\n\t\tPyTuple_SET_ITEM(newaxes, pos++, \n\t\t\t\t PyInt_FromLong((long) i));\n\t}\n\tnew = PyArray_Transpose(self, newaxes);\n\tPy_DECREF(newaxes);\n\tif (new == NULL) return NULL;\n\tself = (PyAO *)new;\n\t\n\tif (n == 2) {\n\t\tPyObject *a=NULL, *indices=NULL, *ret=NULL;\n\t\tintp n1, n2, start, stop, step, count;\n\t\tintp *dptr;\n\t\tn1 = self->dimensions[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; n1<stop; n1+=step) *dptr++ = n1;\n\t\ta = PyArray_IterNew((PyObject *)self);\n\t\tPy_DECREF(self);\n\t\tif (a == NULL) {Py_DECREF(indices); return NULL;}\n\t\tret = PyObject_GetItem(a, indices);\n\t\tPy_DECREF(a);\n\t\tPy_DECREF(indices);\n\t\treturn ret;\n\t}\t\n\n\telse {\n\t\t/* \n\t\t   my_diagonal = []\n\t\t   for i in range (s [0]) :\n\t\t       my_diagonal.append (diagonal (a [i], offset))\n\t\t   return array (my_diagonal)\t\n\t\t*/\t\n\t\tPyObject *mydiagonal=NULL, *new=NULL, *ret=NULL, *sel=NULL;\n\t\tintp i, n1;\n\t\tint res;\n\t\tPyArray_Typecode typecode;\n\n\t\ttypecode.type_num = self->descr->type_num;\n\t\ttypecode.itemsize = self->itemsize;\n\t\ttypecode.fortran = 0;\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<n1; i++) {\n\t\t\tnew = PyInt_FromLong((long) i);\n\t\t\tsel = PyArray_EnsureArray(PyObject_GetItem((PyObject *)self, new));\n\t\t\tPy_DECREF(new);\n\t\t\tif (sel == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnew = PyArray_Diagonal((PyAO *)sel, offset, n-3, n-2);\n\t\t\tPy_DECREF(sel);\n\t\t\tif (new == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tres = PyList_Append(mydiagonal, new);\n\t\t\tPy_DECREF(new);\n\t\t\tif (res < 0) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(self);\n\t\tret =  PyArray_FromAny(mydiagonal, &typecode, 0, 0, 0);\n\t\tPy_DECREF(mydiagonal);\n\t\treturn ret;\n\t}\n}\n\n\n\n\n\n\n/* simulates a C-style 1-3 dimensional array which can be accesed using \n    ptr[i]  or ptr[i][j] or ptr[i][j][k] -- requires pointer allocation \n    for 2-d and 3-d.\n\n    Especially for 2-d and up, ptr is NOT equivalent to a statically defined\n    2-d or 3-d array.  In particular, it cannot be passed into a \n    function that requires a true pointer to a fixed-size array. \n*/\n\nstatic int\nPyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, int type_num) \n{\n\tPyArrayObject *ap;\n\tPyArray_Typecode typecode = {0, 0, 0};\n\tintp n, m, i, j;\n\tchar **ptr2;\n\tchar ***ptr3;\n\n\ttypecode.type_num = type_num;\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot treat flexible type as C array.\");\n\t\treturn -1;\n\t}\n\tif ((nd < 1) || (nd > 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"Only Carrays of 1-3 dimensions available.\");\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, &typecode, 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 **)malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr2[i] = ap->data + 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 ***)malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr3[i] = ptr3[n + (m-1)*i];\n\t\t\tfor (j=0; j<m; j++) {\n\t\t\t\tptr3[i][j] = ap->data + 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\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, typecode) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, typecode) == -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\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\tfree(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<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\tarr = PyArray_FROM_O(otmp);\n\t\tPy_DECREF(otmp);\n\t\tif (arr==NULL) goto fail;\n\t\totmp = PyArray_SwapAxes((PyArrayObject *)arr, axis, 0);\n\t\tPy_DECREF(arr);\n\t\tif (otmp == NULL) goto fail;\n\t\tPyTuple_SET_ITEM(newtup, i, otmp);\n\t}\n\totmp = PyArray_Concatenate(newtup, 0);\n\tPy_DECREF(newtup);\n\tif (otmp == NULL) return NULL;\n\tarr = PyArray_SwapAxes((PyArrayObject *)otmp, axis, 0);\n\tPy_DECREF(otmp);\n\treturn arr;\n\t\n fail:\n\tPy_DECREF(newtup);\n\treturn NULL;\n}\n\n/*op is a python object supporting the sequence interface.\n  Its elements will be concatenated together to form a single \n  multidimensional array.*/\n/* If axis is MAX_DIMS or bigger, then each sequence object will \n   be flattened before concatenation \n*/\nstatic PyObject *\nPyArray_Concatenate(PyObject *op, int axis) \n{\n\tPyArrayObject *ret, **mps;\n\tPyObject *otmp;\n\tint i, n, type_num, tmp, nd=0, new_dim;\n\tchar *data;\t\n\tPyTypeObject *subtype;\n\tdouble prior1, prior2;\n\tintp numbytes;\n\n\tn = PySequence_Length(op);\n\tif (n == -1) {\n\t\treturn NULL;\n\t}\n\tif (n == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Concatenation of zero-length sequences is \"\\\n\t\t\t\t\"impossible.\");\n\t\treturn NULL;\n\t}\n\n\tif ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS)))\n\t\treturn _swap_and_concat(op, axis, n);\n\t\n\tret = NULL;\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\t/* Make sure these arrays are legal to concatenate. */\n\t/* Must have same dimensions except d0, and have coercible type. */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays \"\\\n\t\t\t\t\"to concatenate\");\n\t\tgoto fail;\n\t}\n\n\tprior1 = 0.0;\n\tsubtype = &PyArray_Type;\n\tret = NULL;\n\tfor(i=0; i<n; i++) {\n\t\tPyArray_Typecode typecode = {0, 0, 0};\n\t\ttypecode.type_num = type_num;\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) goto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_FromAny(otmp, &typecode, 0, 0, CARRAY_FLAGS);\n\t\tPy_DECREF(otmp);\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (axis >= 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; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (i == 0) nd = mps[i]->nd;\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\"0d 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\tret = (PyArrayObject *)PyArray_New(subtype, nd,\n\t\t\t\t\t   mps[0]->dimensions, \n\t\t\t\t\t   type_num, NULL, NULL, 0, 0,\n                                           (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; i<n; i++) {\n\t\tnumbytes = PyArray_NBYTES(mps[i]);\n\t\tmemcpy(data, mps[i]->data, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)\n{\n\tPyObject *new_axes;\n\tint n, i, val;\n\tPyObject *ret;\n\n\tif (a1 == a2) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\t\n\tn = ap->nd;\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 = PyTuple_New(n);\n\tfor (i=0; i<n; i++) {\n\t\tif (i == a1) val = a2;\n\t\telse if (i == a2) val = a1;\n\t\telse val = i;\n\t\tPyTuple_SET_ITEM(new_axes, i, PyInt_FromLong((long) val));\n\t}\n\tret = PyArray_Transpose(ap, new_axes);\n\tPy_DECREF(new_axes);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Transpose(PyArrayObject *ap, PyObject *op) {\n\tintp *axes, axis;\n\tintp i, n;\n\tintp *permutation = NULL;\n\tPyArrayObject *ret = NULL;\n\t\n\tif (op == Py_None || op == NULL) {\n\t\tn = ap->nd;\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\tfor(i=0; i<n; i++)\n\t\t\tpermutation[i] = n-1-i;\n\t} else {\n\t\tif (PyArray_AsCArray(&op, (char **)&axes, &n, 1,\n\t\t\t\t PyArray_INTP) == -1)\n\t\t\treturn NULL;\n\t\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\n\t\tfor(i=0; i<n; i++) {\n\t\t\taxis = axes[i];\n\t\t\tif (axis < 0) axis = ap->nd+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\tgoto fail;\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\tret = (PyArrayObject *)PyArray_New(ap->ob_type, n, permutation, \n\t\t\t\t\t   ap->descr->type_num, NULL,\n\t\t\t\t\t   ap->data, ap->itemsize, ap->flags,\n\t\t\t\t\t   (PyObject *)ap);\n\tif (ret == NULL) goto fail;\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; i<n; i++) {\n\t\tret->dimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n\tif (op && (op != Py_None))\n\t\tPyArray_Free(op, (char *)axes);\n\tfree(permutation);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tif (permutation != NULL) free(permutation);\n\tif (op != Py_None)\n\t\tPyArray_Free(op, (char *)axes);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\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; j<n; j++) {\n\t\t\tif (counts[j] < 0) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \"count < 0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\ttotal += counts[j];\n\t\t}\n\t}\n\n\n\t/* Construct new array */\n\taop->dimensions[axis] = total;\n\tret = (PyArrayObject *)PyArray_New(aop->ob_type, aop->nd,\n\t\t\t\t\t   aop->dimensions, \n\t\t\t\t\t   aop->descr->type_num,\n\t\t\t\t\t   NULL, NULL, aop->itemsize, 0,\n\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->itemsize;\n\tfor(i=axis+1; i<aop->nd; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; i<axis; i++) n_outer *= aop->dimensions[i];\n\n\tfor(i=0; i<n_outer; i++) {\n\t\tfor(j=0; j<n; j++) {\n\t\t\ttmp = (nd ? counts[j] : counts[0]);\n\t\t\tfor(k=0; k<tmp; k++) {\n\t\t\t\tmemcpy(new_data, old_data, chunk);\n\t\t\t\tnew_data += chunk;\n\t\t\t}\n\t\t\told_data += chunk;\n\t\t}\n\t}\n\n\tPy_DECREF(repeats);\n\tPyArray_INCREF(ret);\n\tPy_XDECREF(aop);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_DECREF(repeats);\n\tPy_XDECREF(aop);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\nstatic PyObject *\nPyArray_Choose(PyArrayObject *ip, PyObject *op) {\n\tintp i, n, *sizes, m, offset, elsize, type_num;\n\tchar *ret_data;\n\tPyArrayObject **mps, *ap, *ret;\n\tPyObject *otmp;\n\tintp *self_data, mi;\n\tap = NULL;\n\tret = NULL;\n\t\n\tn = PySequence_Length(op);\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\tsizes = (intp *)malloc(n*sizeof(intp));\n\t\n\t/* Figure out the right type for the new array */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays to \"\\\n\t\t\t\t\"choose from\");\n\t\tgoto fail;\n\t}\n\t\n\t/* Make sure all arrays are actual array objects. */\n\tfor(i=0; i<n; i++) {\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n\t\t\tgoto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_ContiguousFromAny(otmp, type_num, \n\t\t\t\t\t\t     0, 0);\n\t\tPy_DECREF(otmp);\n\t}\n\t\n\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ip, \n\t\t\t\t\t\t\t   PyArray_INTP, \n\t\t\t\t\t\t\t   0, 0);\n\tif (ap == NULL) goto fail;\n\t\n\t/* Check the dimensions of the arrays */\n\tfor(i=0; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (ap->nd < 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\t/* why not ??? \n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Not implemented for flexible sizes\");\n\t\treturn NULL;\n\t}\n\t*/\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->itemsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i<m; i++) {\n\t\tmi = *self_data;\n\t\tif (mi < 0 || mi >= 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; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_DECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\n\treturn (PyObject *)ret;\n\t\n fail:\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_XDECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\tPy_XDECREF(ret);\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->compare(a,b,global_obj);\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#define SWAPBACK(op, ap) { \\\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\nstatic PyObject *\nPyArray_Sort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tif ((ap = (PyAO*) _check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_CopyFromObject((PyObject *)op, \n\t\t\t\t\t\t     PyArray_NOTYPE,\n\t\t\t\t\t\t     1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\n\tif (ap->descr->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\n\t}\n\t\n\telsize = ap->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\tqsort(ip, m, elsize, qsortCompare);\n\t}\n\t\n\tglobal_obj = store_arr;\n\t\t\n\tif (PyErr_Occurred()) {\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\t\n\t}\n\n finish:\n\tSWAPBACK(op, ap);\n\n\treturn (PyObject *)op;\n}\n\n\nstatic char *global_data;\n\nstatic int \nargsort_static_compare(const void *ip1, const void *ip2) \n{\n\tint isize = global_obj->itemsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->compare(global_data + (isize * *ipa),\n                                          global_data + (isize * *ipb), \n\t\t\t\t\t  global_obj);\n}\n\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap, *ret, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tif ((ap = (PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op, \n\t\t\t\t\t\t\t   PyArray_NOTYPE,\n\t\t\t\t\t\t\t   1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, PyArray_INTP,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\tif (ap->descr->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\tip = (intp *)ret->data;\n\targsort_elsize = ap->itemsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\tstore_ptr = global_data;\n\tglobal_data = ap->data;\n\tstore = global_obj;\n\tglobal_obj = ap;\n\tfor (i=0; i<n; i++, ip+=m, global_data += m*argsort_elsize) {\n\t\tfor(j=0; j<m; j++) ip[j] = j;\n\t\tqsort((char *)ip, m, sizeof(intp),\n\t\t      argsort_static_compare);\n\t}\n\tglobal_data = store_ptr;\n\tglobal_obj = store;\n\n\n finish:\n\tPy_DECREF(ap);\n\tSWAPBACK(op, ret);\n\treturn (PyObject *)op;\n\n fail:\n\tPy_XDECREF(ap);\n\tPy_XDECREF(ret);\n\treturn NULL;\n\n}  \n\nstatic void \nlocal_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret)\n{\t\n\tPyArray_CompareFunc *compare = ap2->descr->compare;\n\tintp  min_i, max_i, i, j;\n\tint location, elsize = ap1->itemsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_Size((PyObject *)ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j<n; j++, ip+=elsize, rp++) {\n\t\tmin_i = 0;\n\t\tmax_i = elements;\n\t\twhile (min_i != max_i) {\n\t\t\ti = (max_i-min_i)/2 + min_i;\n\t\t\tlocation = compare(ip, vp+elsize*i, ap2);\n\t\t\tif (location == 0) {\n\t\t\t\twhile (i > 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\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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->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\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tret = NULL;\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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->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->itemsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2*l;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1*l;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\t\t\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/* just like inner product but does the swapaxes stuff on the fly */\nstatic PyObject *\nPyArray_MatrixProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tintp matchDim, otherDim, is2r, is1r;\n\tPyTypeObject *subtype;\n        double prior1, prior2;\n\tPyArray_Typecode typec = {0,0,0};\n        \n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\t\n\t\n\ttypec.type_num = typenum;\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 0, 0, \n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_FromAny(op2, &typec, 0, 0,\n\t\t\t\t\t       DEFAULT_FLAGS);\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\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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<j; i++) \n\t   fprintf(stderr, \"%d \", dimensions[i]);\n\t   fprintf(stderr, \"\\n\"); \n\t*/\n\n        /* Choose which subtype to return */\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->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->itemsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2r;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1r;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\n\t\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\nstatic PyObject *\nPyArray_CopyAndTranspose(PyObject *op) \n{\n\tPyObject *ret, *arr;\n\tint nd;\n\tintp dims[2];\n\tintp i,j;\n\tint elsize, str2;\n\tchar *iptr;\n\tchar *optr;\n\n\t/* make sure it is well-behaved */\n\tarr = PyArray_FromAny(op, NULL, 0, 0, CARRAY_FLAGS);\n\tnd = PyArray_NDIM(arr);\n\tif (nd == 1) {     /* we will give in to old behavior */\n\t\tret = PyArray_Copy((PyArrayObject *)arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\t\t\n\t}\n\telse if (nd != 2) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Only 2-d arrays are allowed.\");\n\t\treturn NULL;\n\t}\n\n\t/* Now construct output array */\n\tdims[0] = PyArray_DIM(arr,1);\n\tdims[1] = PyArray_DIM(arr,0);\n\telsize = PyArray_ITEMSIZE(arr);\n\n\tret = PyArray_New(arr->ob_type, 2, dims, PyArray_TYPE(arr),\n\t\t\t  NULL, NULL, elsize, 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; i<dims[0]; i++) {\n\t\tiptr = PyArray_DATA(arr) + i*elsize;\n\t\tfor (j=0; j<dims[1]; j++) {\n\t\t\t/* optr[i,j] = iptr[j,i] */\n\t\t\tmemcpy(optr, iptr, elsize);\n\t\t\toptr += elsize;\n\t\t\tiptr += str2;\n\t\t}\n\t}\n\tPy_DECREF(arr);\n\treturn ret;\n}\n \nstatic PyObject *\nPyArray_Correlate(PyObject *op1, PyObject *op2, int mode) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\n\tintp length;\n\tint i, n1, n2, n, n_left, n_right;\n\tint typenum;\n\tint is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tPyArray_DotFunc *dot;\n\tPyArray_Typecode typec = {0,0,0};\n\t\n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\n\ttypec.type_num = typenum;\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap2 == NULL) goto fail;\n\t\n\tn1 = ap1->dimensions[ap1->nd-1];\n\tn2 = ap2->dimensions[ap2->nd-1];\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 = (int)(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\t\n\tret = (PyArrayObject *)PyArray_New(ap1->ob_type, 1,\n\t\t\t\t\t   &length, typenum, \n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)ap1);\n\tif (ret == NULL) goto fail;\n\n\t\n\tdot = ret->descr->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->itemsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; i<n_left; i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tn++;\n\t\tip2 -= is2;\n\t\top += os;\n\t}\n\tfor(i=0; i<(n1-n2+1); i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tfor(i=0; i<n_right; i++) {\n\t\tn--;\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tif (PyErr_Occurred()) goto fail;\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\nstatic PyObject *\nPyArray_ArgMin(PyArrayObject *ap, int axis) \n{\n\tPyObject *obj, *new, *ret;\n\n\tif (PyArray_ISFLEXIBLE(ap)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"argmax is unsupported for this type.\");\n\t\treturn NULL;\n\t}\n\telse if (PyArray_ISUNSIGNED(ap)) \n\t\tobj = PyInt_FromLong((long) -1);\n\t\n\telse if (PyArray_TYPE(ap)==PyArray_BOOL) \n\t\tobj = PyInt_FromLong((long) 1);\n\t\n\telse \n\t\tobj = PyInt_FromLong((long) 0);\n\t\n\tnew = PyNumber_Subtract(obj, (PyObject *)ap);\n\tif (new == NULL) return NULL;\n\n\tPy_DECREF(obj);\n\tret = PyArray_ArgMax((PyArrayObject *)new, axis);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Max(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.maximum, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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\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->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->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\targ_func(ip, m, rptr, ap);\n\t\trptr += 1;\n\t}\n\tPy_DECREF(ap);\n\n\tSWAPBACK(op, rp);     /* op now contains the return */\n  \n\treturn (PyObject *)op;\n\t\n fail:\n\tPy_DECREF(ap);\n\tPy_XDECREF(rp);\n\treturn NULL;\n}  \n\n\nstatic PyObject *\nPyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n        PyArrayObject *self, *indices, *ret;\n        intp nd, i, j, n, m, max_item, tmp, chunk;\n\tintp shape[MAX_DIMS];\n        char *src, *dest;\n\t\n        indices = ret = NULL;\n\tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n        if (self == NULL) return NULL;\n\t\n        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, \n\t\t\t\t\t\t\t\tPyArray_INTP, \n\t\t\t\t\t\t\t\t1, 0);\n        if (indices == NULL) goto fail;\n\t\n        n = m = chunk = 1;\n        nd = self->nd + 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        ret = (PyArrayObject *)PyArray_New(self->ob_type, nd, shape, \n\t\t\t\t\t   self->descr->type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)self);\n\t\n        if (ret == NULL) goto fail;\n\t\n        max_item = self->dimensions[axis];\n        chunk = chunk * ret->itemsize;\n        src = self->data;\n        dest = ret->data;\n\t\n        for(i=0; i<n; i++) {\n                for(j=0; j<m; j++) {\n                        tmp = ((intp *)(indices->data))[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\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0) \n{\n        PyArrayObject  *indices, *values;\n        int i, chunk, ni, max_item, nv, tmp; \n        char *src, *dest;\n\n        indices = NULL;\n        values = NULL;\n\n        if (!PyArray_Check(self)) {\n                PyErr_SetString(PyExc_ValueError, \"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->itemsize;\n\n        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);\n        if (indices == NULL) goto fail;\n        ni = PyArray_SIZE(indices);\n\n        values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, self->descr->type_num, \n\t\t\t\t\t     0, 0);\n        if (values == NULL) goto fail;\n        nv = PyArray_SIZE(values);\n        if (nv > 0) { /* nv == 0 for a null array */\n                for(i=0; i<ni; i++) {\n                        src = values->data + 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        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\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0) \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_ValueError, \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->itemsize;\n\n        mask = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(mask0, PyArray_BOOL, 0, 0);\n        if (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\t\tfor(i=0; i<ni; i++) {\n\t\t\tsrc = values->data + chunk * (i % nv);\n\t\t\ttmp = ((Bool *)(mask->data))[i];\n\t\t\tif (tmp) {\n\t\t\t\tmemmove(dest + i * chunk, src, chunk);\n\t\t\t\tif (thistype == PyArray_OBJECT)\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\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    \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\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{\n\tif (PyObject_IsTrue(object)) *val=TRUE;\n\telse *val=FALSE;\n\tif (PyErr_Occurred()) return PY_FAIL;\n\treturn PY_SUCCEED;\n}\n\n\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (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\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n        int buflen;\n\n        buf->ptr = NULL;\n        buf->flags = WRITEABLE;\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\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) goto fail;\n        return PY_SUCCEED;\n\n fail:\n\tPyDimMem_FREE(seq->ptr);\n\treturn PY_FAIL;\n}\n\n/* This function takes a Python object representing a type and converts it \n   to a C type_num and an itemsize (elements of PyArray_Typecode structure)\n   \n   Many objects can be used to represent a type.\n */\n\nstatic int\nPyArray_TypecodeConverter(PyObject *obj, PyArray_Typecode *at)\n{\n        char *type;\n        PyArray_Descr *descr;\n        int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item, *attr=NULL;\n\n\tat->itemsize = 0;\n        if (obj == Py_None) {\n                at->type_num = PyArray_NOTYPE;\n                return PY_SUCCEED;\n        }\n\n        if (PyType_Check(obj) && PyType_IsSubtype((PyTypeObject *)obj, \n                                                  &PyGenericArrType_Type)) {\n                PyArray_TypecodeFromTypeObject(obj, at);\n                return PY_SUCCEED;\n        }\n\n\n\t/* type object could be an array */\n\tif (PyArray_Check(obj)) {\n\t\tat->type_num = PyArray_TYPE(obj);\n\t\tat->itemsize = PyArray_ITEMSIZE(obj);\n\t\treturn PY_SUCCEED;\n\t}\n\n\t/* or an array scalar */\n        if (PyArray_IsScalar(obj, Generic)) {\n                PyArray_TypecodeFromScalar(obj, at);\n                return PY_SUCCEED;\n        }\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);\t\t\n\t\tif (len > 0) {\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tif (len > 1) {\n\t\t\tat->itemsize = atoi(type+1);\n\t\t\t/* When specifying length of UNICODE\n\t\t\t   the number of characters is given to match \n\t\t\t   the STRING interface.  Each character can be\n\t\t\t   more than one byte and itemsize must be\n\t\t\t   the number of bytes.\n\t\t\t*/\n\t\t\tif (check_num == PyArray_UNICODELTR ||\t\\\n\t\t\t    check_num == PyArray_UNICODE) \n\t\t\t  at->itemsize *= sizeof(Py_UNICODE);\n\n\t\t\t/* Support for generic processing */\n\t\t\telse if ((check_num != PyArray_STRINGLTR) &&\n\t\t\t\t (check_num != PyArray_VOIDLTR) &&\n\t\t\t\t (check_num != PyArray_STRING) &&\n\t\t\t\t (check_num != PyArray_VOID)) {\n\t\t\t\tcheck_num = \\\n\t\t\t\t\tPyArray_TypestrConvert(at->itemsize,\n\t\t\t\t\t\t\t       check_num);\n\t\t\t        at->itemsize = 0;\n\t\t\t\tif (check_num == PyArray_NOTYPE) goto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Arbitray object with dtypenum and itemsize attributes. */\n\telse if (PyObject_HasAttrString(obj, \"dtypenum\") && \n\t    PyObject_HasAttrString(obj, \"itemsize\")) {\n\t\tattr = PyObject_GetAttrString(obj, \"dtypenum\");\n\t\tcheck_num = PyInt_AsLong(attr);\n\t\tif (PyErr_Occurred()) {  /* not an integer, try character */\n\t\t\tPyErr_Clear();\n\t\t\ttype = PyString_AsString(attr);\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tif (!PyErr_Occurred()) {\n\t\t\tattr = PyObject_GetAttrString(obj, \"itemsize\");\n\t\t\tat->itemsize = PyInt_AsLong(attr);\n\t\t\tPy_XDECREF(attr);\n\t\t}\t\t\t\n\t}\t\t\n\telse if (PyType_Check(obj)) {\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 *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\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                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}\t\n        else { /* Default -- try integer conversion */\n                check_num = PyInt_AsLong(obj);\n\t}\n\n\tif (PyErr_Occurred()) goto fail;\n\n\t/*\n\tif (check_num == PyArray_NOTYPE) return PY_FAIL;\n\t*/\n\tif (check_num == PyArray_NOTYPE) {\n\t\tat->type_num = PyArray_NOTYPE;\n\t\tat->itemsize = 0;\n\t\treturn PY_SUCCEED;\n\t}\n\n        if ((descr = PyArray_DescrFromType(check_num))==NULL) {\n\t\t/* Now check to see if the object is registered\n\t\t   in typeDict */\n\t\tif (typeDict != NULL) {\n\t\t\titem = PyDict_GetItem(typeDict, obj);\n\t\t\tif (item) {\n\t\t\t\tPyArray_TypecodeFromTypeObject(obj, at);\n\t\t\t\tPyErr_Clear();\n\t\t\t\treturn PY_SUCCEED;\n\t\t\t}\n\t\t}\n                return PY_FAIL;\n\t}\n\t\n        at->type_num = descr->type_num;\n\tif (at->itemsize == 0) at->itemsize = descr->elsize;\n\t\n        return PY_SUCCEED;\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\treturn PY_FAIL;\n}\t\n\n\n/* This function returns true if the two typecodes are \n   equivalent (same basic kind and same itemsize).\n*/\n\nstatic Bool\nPyArray_EquivalentTypes(PyArray_Typecode *typ1, PyArray_Typecode *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->itemsize;\n\tregister int size2=typ2->itemsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typenum1==typenum2) return TRUE;\n\n\t/* If we are here then size1 == size2 */\n\tif (typenum1 < PyArray_FLOAT) {\n\t\tif (PyTypeNum_ISBOOL(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISBOOL(typenum2));\n\t\telse if (PyTypeNum_ISUNSIGNED(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISUNSIGNED(typenum2));\n\t\telse \n\t\t\treturn (Bool)(PyTypeNum_ISSIGNED(typenum2));\n\t}\n\telse {\n\t\tif (PyTypeNum_ISFLOAT(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISFLOAT(typenum2));\n\t\telse if (PyTypeNum_ISCOMPLEX(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISCOMPLEX(typenum2));\n\t}\n\t/* Default size1 != size2 and typenum1 != typenum2 */\n\treturn FALSE;\t\n}\n\nstatic Bool \nPyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n{\n        PyArray_Typecode type1={0,0,0};\n        PyArray_Typecode type2={0,0,0};\n\n\ttype1.type_num = PyArray_TYPE(a1);\n\ttype2.type_num = PyArray_TYPE(a2);\n\ttype1.itemsize = PyArray_ITEMSIZE(a1);\n\ttype2.itemsize = PyArray_ITEMSIZE(a2);\n\t\t\t\n        return PyArray_EquivalentTypes(&type1, &type2);\n}\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_Typecode type = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n\tint type_num;\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_TypecodeConverter,\n                                        &type, \n\t\t\t\t\tPyArray_BoolConverter, &copy, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n                                        PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\ttype_num = type.type_num;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\\n            (copy==0) &&                                             \\\n\t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n\t\tif (type_num == PyArray_NOTYPE) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t\t/* One more chance */\n\t\toldtype.type_num = PyArray_TYPE(op);\n\t\toldtype.itemsize = PyArray_ITEMSIZE(op);\n\t\tif (PyArray_EquivalentTypes(&oldtype, &type)) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t}\n\n\ttype.fortran = fortran; \n\tif (copy) {\n\t\tflags = ENSURECOPY;\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\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n        \n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Empty(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypestr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. typestr must be a valid data typestr (complete with < > or |).  If dtypestr is object, 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[] = {\"dtypestr\",\"obj\", NULL};\n\tPyArray_Typecode typecode;\n\tPyObject *obj=NULL;\n\tchar *typestr;\n\tint typestrlen;\n\tint swap, alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"z#|O\",\n\t\t\t\t\t kwlist, &typestr, &typestrlen,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\n\tif (_array_typecode_fromstr(typestr, &swap, &typecode) < 0) \n\t\treturn NULL;\n\t\n\tif (typecode.itemsize == 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\tswap = 0;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = malloc(typecode.itemsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode.itemsize);\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_ValueError, \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.itemsize) {\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.type_num,\n\t\t\t     typecode.itemsize, swap); \n\n\t/* free dptr which contains zeros */\n\tif (alloc) free(dptr);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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 {\t\t\n\t\tmemset(ret->data, 0, n*(ret->itemsize));\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Zeros(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return 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\nstatic char doc_fromString[] = \"fromstring(string, dtype=intp, count=-1, swap=False) 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\tPyArrayObject *ret; \n\tchar *data;\n\tlonglong nin=-1;\n\tintp s, n;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", \"swap\",NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint itemsize;\n\tint swapped=FALSE;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&LO&\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &swapped)) {\n\t\treturn NULL;\n\t}\n\t\n\tn = (intp) nin;\n\n\titemsize = type.itemsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize.\");\n\t\treturn NULL;\n\t}\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\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\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\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype.type_num, NULL, \n\t\t\t\t\t\tNULL, itemsize, 0,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*ret->itemsize);\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPyArray_INCREF(ret);\n\treturn (PyObject *)ret;\n}\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\nstatic int\n_fill_in_itemsize(PyArray_Typecode *typecode)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(typecode->type_num);\n\tif (descr==NULL) return -1;\n\ttypecode->itemsize = descr->elsize;\n\treturn 0;\n}\n\n\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Typecode *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\n\tif (typecode->itemsize == 0) {\n\t\tif (_fill_in_itemsize(typecode) < 0) \n\t\t\treturn NULL;\n\t}\n\n\tif (num == -1 && sep == NULL) {  /* 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\tfseek(fp, (long) start, SEEK_SET);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \"Could not seek in file.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif (typecode->itemsize == 0) {\n\t\t\ttypecode->itemsize = numbytes;\n\t\t\tnum = 1;\n\t\t}\n\t\telse {\n\t\t\tnum = numbytes / typecode->itemsize;\n\t\t}\n\t}\n\t\n\tif (sep==NULL) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &num, \n\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t typecode->itemsize, 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->itemsize, 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 = PyArray_DescrFromType(typecode->type_num)->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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &num, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\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, r->itemsize, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->itemsize;\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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &size, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->itemsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, r->itemsize, 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->itemsize;\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->itemsize);\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->itemsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=intp, count=-1, sep='')\\n\"\\\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_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\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, \"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\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Typecode *type, \n\t\t   intp count, int swapped) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\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\treturn NULL;\n\t}\n\tif (type->itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Itemsize cannot be zero in type\");\n\t\treturn NULL;\n\t}\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\treturn NULL;\n\t\t}\n\t}\n\ts = (intp)ts;\t\n\tn = (intp)count;\n\titemsize = type->itemsize;\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\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\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype->type_num, NULL, \n\t\t\t\t\t\tdata, itemsize, DEFAULT_FLAGS,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPy_INCREF(buf);\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret; \t\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=intp, count=-1, swap=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 the buffer has data that is out\\n\" \\\n\t\"   not in machine byte-order, than set swap=1.  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;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", \n\t\t\t\t \"swap\", NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint swapped=0;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Li\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &swapped)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromBuffer(obj, &type, (intp)nin, swapped);\n}\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\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length, i;\n\tPyObject *range;\n\tchar *rptr;\n\tint elsize, type;\n\tdouble value;\n\tPyArray_Descr *dbl_descr;\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\tdbl_descr = PyArray_DescrFromType(PyArray_DOUBLE);\n    \n\trptr = ((PyArrayObject *)range)->data;\n\telsize = ((PyArrayObject *)range)->itemsize;\n\ttype = ((PyArrayObject *)range)->descr->type_num;\n\tfor (i=0; i < length; i++) {\n\t\tvalue = start + i*step;\n\t\tdbl_descr->cast[type]((char*)&value, rptr, 1, NULL, \n\t\t\t\t      (PyArrayObject *)range);\n\t\trptr += elsize;\n\t}\n    \n\treturn range;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=intp)\\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=Py_None, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tdouble start, stop, step;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0};\n\tint type_num;\n\tint deftype = PyArray_INTP;\n\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_TypecodeConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\tdeftype = PyArray_ObjectType(o_start, deftype);\n\tif (o_stop != Py_None) {\n\t\tdeftype = PyArray_ObjectType(o_stop, deftype);\n\t}\n\tif (o_step != NULL) {\n\t\tdeftype = PyArray_ObjectType(o_step, deftype);\n\t}\n\n\ttype_num = typecode.type_num;\n\tif (type_num == PyArray_NOTYPE) {\n\t\ttype_num = deftype;\n\t}\n\n\tstart = PyFloat_AsDouble(o_start);\n\tif error_converting(start) return NULL;\n\n\tif (o_step == NULL) {\n\t\tstep = 1;\n\t}\n\telse {\n\t\tstep = PyFloat_AsDouble(o_step);\n\t\tif error_converting(step) return NULL;\n\t}\n\n\tif (o_stop == Py_None) {\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\telse {\n\t\tstop = PyFloat_AsDouble(o_stop);\n\t\tif error_converting(stop) return NULL;\n\t}\n\n\treturn PyArray_Arange(start, stop, step, type_num);\n}\n\n#undef _ARET\n\n/*****\n      static char doc_arrayMap[] = \"arrayMap(func, [a1,...,an])\";\n\n      static PyObject *array_arrayMap(PyObject *dummy, PyObject *args) {\n      PyObject *shape, *a0;\n  \n      if (PyArg_ParseTuple(args, \"OO\", &a0, &shape) == NULL) return NULL;\n\t\n      return PyArray_Map(a0, shape);\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\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 (PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"One or more objects is not callable.\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\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\tif ((x==NULL) || (y==NULL)) {\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\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\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, n_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_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_Typecode d1={PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode d2={PyArray_NOTYPE, 0, 0};\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_TypecodeConverter, &d1,\n\t\t\t\t\tPyArray_TypecodeConverter, &d2))\n\t\treturn NULL;\n\tif (d1.type_num == PyArray_NOTYPE || \\\n\t    d2.type_num == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types. \"\\\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 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{\"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/*  {\"arrayMap\",\t(PyCFunction)array_arrayMap, \n\t    METH_VARARGS, doc_arrayMap},*/\n\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_Tyupe\",  \\\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(Numeric, Generic);\n        SINGLE_INHERIT(Integer, Numeric);\n        SINGLE_INHERIT(Inexact, Numeric);\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        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        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        SINGLE_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\t   \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, \"NOTSWAPPED\", s=PyInt_FromLong(NOTSWAPPED));\n        Py_DECREF(s);\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\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n                return; \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\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) \n                return;  /* otherwise there is an error */\n\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/*\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 scipy_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 <string.h>\n#include <math.h>\n*/\n\n#define _MULTIARRAYMODULE\n#include \"scipy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL;   /* Must be explicitly loaded */\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\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\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\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\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n        int i;\n        for(i=0;i<n;i++) {\n                if (l1[i] != l2[i]) return 0;\n        } \n        return 1;\n}\n\nstatic PyObject *\nPyArray_View(PyArrayObject *self, PyArray_Typecode *type)\n{\n\tPyObject *new=NULL;\n        PyObject *v=NULL;\n        int type_num = PyArray_NOTYPE;\n\n\tif (type) {\n\t\ttype_num = type->type_num;\n\t}\n\n\tnew = PyArray_New(self->ob_type,\n\t\t\t  self->nd, self->dimensions,\n\t\t\t  self->descr->type_num,\n\t\t\t  self->strides,\n\t\t\t  self->data,\n\t\t\t  self->itemsize,\n\t\t\t  self->flags, (PyObject *)self);\n\n\tif (new==NULL) return NULL;\n\t\n        Py_INCREF(self);\n        PyArray_BASE(new) = (PyObject *)self;\n        if ((type_num != PyArray_NOTYPE) &&             \\\n            (type_num != self->descr->type_num)) {\n                if (!PyTypeNum_ISFLEXIBLE(type_num)) {\n                        v = PyArray_TypeObjectFromType(type_num);\n                }\n                else {\n                        PyArray_Descr *descr;\n                        int itemsize = type->itemsize;\n                        descr = PyArray_DescrFromType(type_num);\n                        if (type_num == PyArray_UNICODE) \n                                itemsize /= sizeof(Py_UNICODE);\n                        /* construct a string representation */\n                        v = PyString_FromFormat(\"%c%d\", descr->type, \n                                                itemsize);\n                }\n                if (v == NULL) goto fail;\n                /* set attribute new.dtype = newtype */\n                if (PyObject_SetAttrString(new, \"dtype\", v) < 0) goto fail;\n                Py_DECREF(v);\n        }\n\treturn new;\t\n\n fail:\n        Py_XDECREF(v);\n        Py_XDECREF(new);\n        return NULL;\n}\n\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n        if (a->nd == 1) {\n                Py_INCREF(a);\n                return (PyObject *)a;\n        }\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) \n\t\treturn PyArray_Newshape(a, &newdim);\n\telse\n\t        return PyArray_Flatten(a, fortran);\n}\n\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tsize = PyArray_SIZE(a);\n\tret = PyArray_New(a->ob_type,\n\t\t\t  1, &size,\n\t\t\t  a->descr->type_num,\n\t\t\t  NULL,\n                          NULL,\n\t\t\t  a->itemsize,\n\t\t\t  0, (PyObject *)a);\n\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\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\n/* Returns a new array \n   with the a new shape from the data\n   in the old array\n*/\n\nstatic PyObject * \nPyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims)\n{\n        intp i, s_original, i_unknown, s_known;\n        intp *dimensions = newdims->ptr;\n        PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n        Bool same;\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<n) {\n                        if (PyArray_DIM(self,i) != dimensions[i]) \n                                same=FALSE;\n                        i++;\n                }\n                if (same) return PyArray_View(self, NULL);\n        }\n\n        if (!PyArray_ISCONTIGUOUS(self)) {\n                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"changing shape only works on contiguous arrays\");\n                return NULL;\n        }\n\t\n        s_known = 1;\n        i_unknown = -1;\n\n        for(i=0; i<n; i++) {\n                if (dimensions[i] < 0) {\n                        if (i_unknown == -1) {\n                                i_unknown = i;\n                        } else {\n                                PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"can only specify one \"\t\\\n\t\t\t\t\t\t\" unknown dimension\");\n                                goto fail;\n                        }\n                } else {\n\t\t\ts_known *= dimensions[i];\n                }\n        }\n\t\n        s_original = PyArray_SIZE(self);\n\t\n        if (i_unknown >= 0) {\n                if ((s_known == 0) || (s_original % s_known != 0)) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n                dimensions[i_unknown] = s_original/s_known;\n        } else {\n                if (s_original != s_known) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        goto fail;\n                }\n        }\n        \n\tret = (PyAO *)PyArray_New(self->ob_type,\n\t\t\t\t  n, dimensions,\n\t\t\t\t  self->descr->type_num,\n\t\t\t\t  NULL,\n\t\t\t\t  self->data,\n\t\t\t\t  self->itemsize,\n\t\t\t\t  self->flags, (PyObject *)self);\n\n\tif (ret== NULL)\n                goto fail;\n\t\n        Py_INCREF(self);\n        ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n        return (PyObject *)ret;\n\t\n fail:\n        return NULL;\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\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; i<nd; i++) {\n\t\tif (self->dimensions[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\tret = PyArray_New(self->ob_type, newnd, dimensions, \n\t\t\t  self->descr->type_num, strides,\n\t\t\t  self->data, self->itemsize, self->flags,\n\t\t\t  (PyObject *)self);\n\tself->flags &= ~OWN_DATA;\n\tself->base = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\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\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype)\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; i<n; i++) {\n\t\tif (i==axis) val = 1;\n\t\telse val = PyArray_DIM(new,i);\n\t\tPyTuple_SET_ITEM(newshape, i, PyInt_FromLong((long)val));\n\t}\n\tobj2 = PyArray_Reshape((PyAO *)obj1, newshape);\n\tPy_DECREF(obj1);\n\tPy_DECREF(newshape);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x = x - mx */\n\tobj1 = PyNumber_Subtract((PyObject *)self, obj2);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute x * x */\n\tobj2 = PyNumber_Multiply(obj1, obj1);\n\tPy_DECREF(obj1);\n\tif (obj2 == NULL) {Py_DECREF(new); return NULL;}\n\n\t/* Compute add.reduce(x*x,axis) */\n\tobj1 = PyArray_GenericReduceFunction((PyArrayObject *)obj2, n_ops.add,\n\t\t\t\t\t     axis, rtype);\n\tPy_DECREF(obj2);\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;}\n\n\tn = PyArray_DIM(new,axis)-1;\n\tPy_DECREF(new);\n\tif (n==0) n=1;\n\tobj2 = PyFloat_FromDouble(1.0/((double )n));\n\tif (obj2 == NULL) {Py_DECREF(obj1); return NULL;}\n\tret = PyArray_EnsureArray(PyNumber_Multiply(obj1, obj2));\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\n\t/* sqrt() */\n\tobj1 = PyArray_GenericUnaryFunction((PyAO *)ret, n_ops.sqrt);\n\tPy_DECREF(ret);\n\n\treturn obj1;\n}\n\n\nstatic PyObject *\nPyArray_Sum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis, \n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Prod(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, n_ops.multiply, axis,\n\t\t\t\t\t    rtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumSum(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_CumProd(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericAccumulateFunction((PyAO *)new, \n\t\t\t\t\t\tn_ops.multiply, axis,\n\t\t\t\t\t\trtype);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Any(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_or, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_All(PyArrayObject *self, int axis)\n{\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tret = PyArray_GenericReduceFunction((PyAO *)new, \n\t\t\t\t\t    n_ops.logical_and, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Compress(PyArrayObject *self, PyObject *condition, int axis)\n{\n        PyArrayObject *cond;\n\tPyObject *res, *ret;\n\n        cond = (PyAO *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n        if (cond == NULL) return NULL;\n        \n        if (cond->nd != 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\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; i<size; i++) {\n\t\tif (self->descr->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; i<size; i++) {\n\t\t\tif (self->descr->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; j<n; j++) {\n\t\t\titem = PyArray_New(self->ob_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\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tif (item == NULL) goto fail;\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; i<size; i++) {\n\t\t\tif (self->descr->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; j<n; j++) \n\t\t\t\t\t*(dptr[j])++ = it->coordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n        \n}\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)) goto fail;\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) goto fail;\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(res1);\n\tPy_XDECREF(res2);\n\tPy_XDECREF(two);\n\tPy_XDECREF(selector);\n\treturn NULL;\n}\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_Copy(self);\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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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; i<size; i++) {\n\t\t\t\tdptr->imag = -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\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\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyObject *newaxes;\n\tint i, pos;\t\n\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 = PyTuple_New(n);\n\tif (newaxes==NULL) return NULL;\n\t/* insert at the end */\n\tPyTuple_SET_ITEM(newaxes, n-2, PyInt_FromLong((long)axis1));\n\tPyTuple_SET_ITEM(newaxes, n-1, PyInt_FromLong((long)axis2));\n\tpos = 0;\n\tfor (i=0; i<n; i++) {\n\t\tif ((i==axis1) || (i==axis2)) continue;\n\t\tPyTuple_SET_ITEM(newaxes, pos++, \n\t\t\t\t PyInt_FromLong((long) i));\n\t}\n\tnew = PyArray_Transpose(self, newaxes);\n\tPy_DECREF(newaxes);\n\tif (new == NULL) return NULL;\n\tself = (PyAO *)new;\n\t\n\tif (n == 2) {\n\t\tPyObject *a=NULL, *indices=NULL, *ret=NULL;\n\t\tintp n1, n2, start, stop, step, count;\n\t\tintp *dptr;\n\t\tn1 = self->dimensions[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; n1<stop; n1+=step) *dptr++ = n1;\n\t\ta = PyArray_IterNew((PyObject *)self);\n\t\tPy_DECREF(self);\n\t\tif (a == NULL) {Py_DECREF(indices); return NULL;}\n\t\tret = PyObject_GetItem(a, indices);\n\t\tPy_DECREF(a);\n\t\tPy_DECREF(indices);\n\t\treturn ret;\n\t}\t\n\n\telse {\n\t\t/* \n\t\t   my_diagonal = []\n\t\t   for i in range (s [0]) :\n\t\t       my_diagonal.append (diagonal (a [i], offset))\n\t\t   return array (my_diagonal)\t\n\t\t*/\t\n\t\tPyObject *mydiagonal=NULL, *new=NULL, *ret=NULL, *sel=NULL;\n\t\tintp i, n1;\n\t\tint res;\n\t\tPyArray_Typecode typecode;\n\n\t\ttypecode.type_num = self->descr->type_num;\n\t\ttypecode.itemsize = self->itemsize;\n\t\ttypecode.fortran = 0;\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<n1; i++) {\n\t\t\tnew = PyInt_FromLong((long) i);\n\t\t\tsel = PyArray_EnsureArray(PyObject_GetItem((PyObject *)self, new));\n\t\t\tPy_DECREF(new);\n\t\t\tif (sel == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnew = PyArray_Diagonal((PyAO *)sel, offset, n-3, n-2);\n\t\t\tPy_DECREF(sel);\n\t\t\tif (new == NULL) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tres = PyList_Append(mydiagonal, new);\n\t\t\tPy_DECREF(new);\n\t\t\tif (res < 0) {\n\t\t\t\tPy_DECREF(self);\n\t\t\t\tPy_DECREF(mydiagonal);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(self);\n\t\tret =  PyArray_FromAny(mydiagonal, &typecode, 0, 0, 0);\n\t\tPy_DECREF(mydiagonal);\n\t\treturn ret;\n\t}\n}\n\n\n\n\n\n\n/* simulates a C-style 1-3 dimensional array which can be accesed using \n    ptr[i]  or ptr[i][j] or ptr[i][j][k] -- requires pointer allocation \n    for 2-d and 3-d.\n\n    Especially for 2-d and up, ptr is NOT equivalent to a statically defined\n    2-d or 3-d array.  In particular, it cannot be passed into a \n    function that requires a true pointer to a fixed-size array. \n*/\n\nstatic int\nPyArray_AsCArray(PyObject **op, void *ptr, intp *dims, int nd, int type_num) \n{\n\tPyArrayObject *ap;\n\tPyArray_Typecode typecode = {0, 0, 0};\n\tintp n, m, i, j;\n\tchar **ptr2;\n\tchar ***ptr3;\n\n\ttypecode.type_num = type_num;\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot treat flexible type as C array.\");\n\t\treturn -1;\n\t}\n\tif ((nd < 1) || (nd > 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"Only Carrays of 1-3 dimensions available.\");\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, &typecode, 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 **)malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr2[i] = ap->data + 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 ***)malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tptr3[i] = ptr3[n + (m-1)*i];\n\t\t\tfor (j=0; j<m; j++) {\n\t\t\t\tptr3[i][j] = ap->data + 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\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, typecode) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, typecode) == -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\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\tfree(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<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\tarr = PyArray_FROM_O(otmp);\n\t\tPy_DECREF(otmp);\n\t\tif (arr==NULL) goto fail;\n\t\totmp = PyArray_SwapAxes((PyArrayObject *)arr, axis, 0);\n\t\tPy_DECREF(arr);\n\t\tif (otmp == NULL) goto fail;\n\t\tPyTuple_SET_ITEM(newtup, i, otmp);\n\t}\n\totmp = PyArray_Concatenate(newtup, 0);\n\tPy_DECREF(newtup);\n\tif (otmp == NULL) return NULL;\n\tarr = PyArray_SwapAxes((PyArrayObject *)otmp, axis, 0);\n\tPy_DECREF(otmp);\n\treturn arr;\n\t\n fail:\n\tPy_DECREF(newtup);\n\treturn NULL;\n}\n\n/*op is a python object supporting the sequence interface.\n  Its elements will be concatenated together to form a single \n  multidimensional array.*/\n/* If axis is MAX_DIMS or bigger, then each sequence object will \n   be flattened before concatenation \n*/\nstatic PyObject *\nPyArray_Concatenate(PyObject *op, int axis) \n{\n\tPyArrayObject *ret, **mps;\n\tPyObject *otmp;\n\tint i, n, type_num, tmp, nd=0, new_dim;\n\tchar *data;\t\n\tPyTypeObject *subtype;\n\tdouble prior1, prior2;\n\tintp numbytes;\n\n\tn = PySequence_Length(op);\n\tif (n == -1) {\n\t\treturn NULL;\n\t}\n\tif (n == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Concatenation of zero-length sequences is \"\\\n\t\t\t\t\"impossible.\");\n\t\treturn NULL;\n\t}\n\n\tif ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS)))\n\t\treturn _swap_and_concat(op, axis, n);\n\t\n\tret = NULL;\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\t/* Make sure these arrays are legal to concatenate. */\n\t/* Must have same dimensions except d0, and have coercible type. */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays \"\\\n\t\t\t\t\"to concatenate\");\n\t\tgoto fail;\n\t}\n\n\tprior1 = 0.0;\n\tsubtype = &PyArray_Type;\n\tret = NULL;\n\tfor(i=0; i<n; i++) {\n\t\tPyArray_Typecode typecode = {0, 0, 0};\n\t\ttypecode.type_num = type_num;\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) goto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_FromAny(otmp, &typecode, 0, 0, CARRAY_FLAGS);\n\t\tPy_DECREF(otmp);\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (axis >= 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; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (i == 0) nd = mps[i]->nd;\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\"0d 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\tret = (PyArrayObject *)PyArray_New(subtype, nd,\n\t\t\t\t\t   mps[0]->dimensions, \n\t\t\t\t\t   type_num, NULL, NULL, 0, 0,\n                                           (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; i<n; i++) {\n\t\tnumbytes = PyArray_NBYTES(mps[i]);\n\t\tmemcpy(data, mps[i]->data, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tfree(mps);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)\n{\n\tPyObject *new_axes;\n\tint n, i, val;\n\tPyObject *ret;\n\n\tif (a1 == a2) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\t\n\tn = ap->nd;\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 = PyTuple_New(n);\n\tfor (i=0; i<n; i++) {\n\t\tif (i == a1) val = a2;\n\t\telse if (i == a2) val = a1;\n\t\telse val = i;\n\t\tPyTuple_SET_ITEM(new_axes, i, PyInt_FromLong((long) val));\n\t}\n\tret = PyArray_Transpose(ap, new_axes);\n\tPy_DECREF(new_axes);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Transpose(PyArrayObject *ap, PyObject *op) {\n\tintp *axes, axis;\n\tintp i, n;\n\tintp *permutation = NULL;\n\tPyArrayObject *ret = NULL;\n\t\n\tif (op == Py_None || op == NULL) {\n\t\tn = ap->nd;\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\tfor(i=0; i<n; i++)\n\t\t\tpermutation[i] = n-1-i;\n\t} else {\n\t\tif (PyArray_AsCArray(&op, (char **)&axes, &n, 1,\n\t\t\t\t PyArray_INTP) == -1)\n\t\t\treturn NULL;\n\t\n\t\tpermutation = (intp *)malloc(n*sizeof(int));\n\t\n\t\tfor(i=0; i<n; i++) {\n\t\t\taxis = axes[i];\n\t\t\tif (axis < 0) axis = ap->nd+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\tgoto fail;\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\tret = (PyArrayObject *)PyArray_New(ap->ob_type, n, permutation, \n\t\t\t\t\t   ap->descr->type_num, NULL,\n\t\t\t\t\t   ap->data, ap->itemsize, ap->flags,\n\t\t\t\t\t   (PyObject *)ap);\n\tif (ret == NULL) goto fail;\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; i<n; i++) {\n\t\tret->dimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n\tif (op && (op != Py_None))\n\t\tPyArray_Free(op, (char *)axes);\n\tfree(permutation);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ret);\n\tif (permutation != NULL) free(permutation);\n\tif (op != Py_None)\n\t\tPyArray_Free(op, (char *)axes);\n\treturn NULL;\n}\n\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis) {\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; j<n; j++) {\n\t\t\tif (counts[j] < 0) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \"count < 0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\ttotal += counts[j];\n\t\t}\n\t}\n\n\n\t/* Construct new array */\n\taop->dimensions[axis] = total;\n\tret = (PyArrayObject *)PyArray_New(aop->ob_type, aop->nd,\n\t\t\t\t\t   aop->dimensions, \n\t\t\t\t\t   aop->descr->type_num,\n\t\t\t\t\t   NULL, NULL, aop->itemsize, 0,\n\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->itemsize;\n\tfor(i=axis+1; i<aop->nd; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; i<axis; i++) n_outer *= aop->dimensions[i];\n\n\tfor(i=0; i<n_outer; i++) {\n\t\tfor(j=0; j<n; j++) {\n\t\t\ttmp = (nd ? counts[j] : counts[0]);\n\t\t\tfor(k=0; k<tmp; k++) {\n\t\t\t\tmemcpy(new_data, old_data, chunk);\n\t\t\t\tnew_data += chunk;\n\t\t\t}\n\t\t\told_data += chunk;\n\t\t}\n\t}\n\n\tPy_DECREF(repeats);\n\tPyArray_INCREF(ret);\n\tPy_XDECREF(aop);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_DECREF(repeats);\n\tPy_XDECREF(aop);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\nstatic PyObject *\nPyArray_Choose(PyArrayObject *ip, PyObject *op) {\n\tintp i, n, *sizes, m, offset, elsize, type_num;\n\tchar *ret_data;\n\tPyArrayObject **mps, *ap, *ret;\n\tPyObject *otmp;\n\tintp *self_data, mi;\n\tap = NULL;\n\tret = NULL;\n\t\n\tn = PySequence_Length(op);\n\t\n\tmps = (PyArrayObject **)malloc(n*sizeof(PyArrayObject *));\n\tif (mps == NULL) {\n\t\tPyErr_SetString(PyExc_MemoryError, \"memory error\");\n\t\treturn NULL;\n\t}\n\t\n\tsizes = (intp *)malloc(n*sizeof(intp));\n\t\n\t/* Figure out the right type for the new array */\n\t\n\ttype_num = 0;\n\tfor(i=0; i<n; i++) {\n\t\totmp = PySequence_GetItem(op, i);\n\t\ttype_num = PyArray_ObjectType(otmp, type_num);\n\t\tmps[i] = NULL;\n\t\tPy_XDECREF(otmp);\n\t}\n\tif (type_num == -1) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"can't find common type for arrays to \"\\\n\t\t\t\t\"choose from\");\n\t\tgoto fail;\n\t}\n\t\n\t/* Make sure all arrays are actual array objects. */\n\tfor(i=0; i<n; i++) {\n\t\tif ((otmp = PySequence_GetItem(op, i)) == NULL) \n\t\t\tgoto fail;\n\t\tmps[i] = (PyArrayObject*)\n\t\t\tPyArray_ContiguousFromAny(otmp, type_num, \n\t\t\t\t\t\t     0, 0);\n\t\tPy_DECREF(otmp);\n\t}\n\t\n\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ip, \n\t\t\t\t\t\t\t   PyArray_INTP, \n\t\t\t\t\t\t\t   0, 0);\n\tif (ap == NULL) goto fail;\n\t\n\t/* Check the dimensions of the arrays */\n\tfor(i=0; i<n; i++) {\n\t\tif (mps[i] == NULL) goto fail;\n\t\tif (ap->nd < 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\t/* why not ??? \n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tPyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Not implemented for flexible sizes\");\n\t\treturn NULL;\n\t}\n\t*/\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->itemsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i<m; i++) {\n\t\tmi = *self_data;\n\t\tif (mi < 0 || mi >= 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; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_DECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\n\treturn (PyObject *)ret;\n\t\n fail:\n\tfor(i=0; i<n; i++) Py_XDECREF(mps[i]);\n\tPy_XDECREF(ap);\n\tfree(mps);\n\tfree(sizes);\n\tPy_XDECREF(ret);\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->compare(a,b,global_obj);\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#define SWAPBACK(op, ap) { \\\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\nstatic PyObject *\nPyArray_Sort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tif ((ap = (PyAO*) _check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_CopyFromObject((PyObject *)op, \n\t\t\t\t\t\t     PyArray_NOTYPE,\n\t\t\t\t\t\t     1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\n\tif (ap->descr->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\n\t}\n\t\n\telsize = ap->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\tqsort(ip, m, elsize, qsortCompare);\n\t}\n\t\n\tglobal_obj = store_arr;\n\t\t\n\tif (PyErr_Occurred()) {\n\t\tPy_DECREF(ap);\n\t\treturn NULL;\t\n\t}\n\n finish:\n\tSWAPBACK(op, ap);\n\n\treturn (PyObject *)op;\n}\n\n\nstatic char *global_data;\n\nstatic int \nargsort_static_compare(const void *ip1, const void *ip2) \n{\n\tint isize = global_obj->itemsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->compare(global_data + (isize * *ipa),\n                                          global_data + (isize * *ipb), \n\t\t\t\t\t  global_obj);\n}\n\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap, *ret, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tif ((ap = (PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op, \n\t\t\t\t\t\t\t   PyArray_NOTYPE,\n\t\t\t\t\t\t\t   1, 0);\n\tPy_DECREF(op);\n\n\tif (ap == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd,\n\t\t\t\t\t   ap->dimensions, PyArray_INTP,\n\t\t\t\t\t   NULL, NULL, 0, 0, (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\tif (ap->descr->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\tip = (intp *)ret->data;\n\targsort_elsize = ap->itemsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\tstore_ptr = global_data;\n\tglobal_data = ap->data;\n\tstore = global_obj;\n\tglobal_obj = ap;\n\tfor (i=0; i<n; i++, ip+=m, global_data += m*argsort_elsize) {\n\t\tfor(j=0; j<m; j++) ip[j] = j;\n\t\tqsort((char *)ip, m, sizeof(intp),\n\t\t      argsort_static_compare);\n\t}\n\tglobal_data = store_ptr;\n\tglobal_obj = store;\n\n\n finish:\n\tPy_DECREF(ap);\n\tSWAPBACK(op, ret);\n\treturn (PyObject *)op;\n\n fail:\n\tPy_XDECREF(ap);\n\tPy_XDECREF(ret);\n\treturn NULL;\n\n}  \n\nstatic void \nlocal_where(PyArrayObject *ap1, PyArrayObject *ap2, PyArrayObject *ret)\n{\t\n\tPyArray_CompareFunc *compare = ap2->descr->compare;\n\tintp  min_i, max_i, i, j;\n\tint location, elsize = ap1->itemsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_Size((PyObject *)ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j<n; j++, ip+=elsize, rp++) {\n\t\tmin_i = 0;\n\t\tmax_i = elements;\n\t\twhile (min_i != max_i) {\n\t\t\ti = (max_i-min_i)/2 + min_i;\n\t\t\tlocation = compare(ip, vp+elsize*i, ap2);\n\t\t\tif (location == 0) {\n\t\t\t\twhile (i > 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\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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->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\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tret = NULL;\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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->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->itemsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2*l;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1*l;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\t\t\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/* just like inner product but does the swapaxes stuff on the fly */\nstatic PyObject *\nPyArray_MatrixProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\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\tintp matchDim, otherDim, is2r, is1r;\n\tPyTypeObject *subtype;\n        double prior1, prior2;\n\tPyArray_Typecode typec = {0,0,0};\n        \n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\t\n\t\n\ttypec.type_num = typenum;\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 0, 0, \n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_FromAny(op2, &typec, 0, 0,\n\t\t\t\t\t       DEFAULT_FLAGS);\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\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; i<ap1->nd-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; i<ap2->nd-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<j; i++) \n\t   fprintf(stderr, \"%d \", dimensions[i]);\n\t   fprintf(stderr, \"\\n\"); \n\t*/\n\n        /* Choose which subtype to return */\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->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->itemsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1<n1; i1++) {\n\t\tip2 = ap2->data;\n\t\tfor(i2=0; i2<n2; i2++) {\n\t\t\tdot(ip1, is1, ip2, is2, op, l, ret);\n\t\t\tip2 += is2r;\n\t\t\top += os;\n\t\t}\n\t\tip1 += is1r;\n\t}\n\tif (PyErr_Occurred()) goto fail;\n\n\t\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\nstatic PyObject *\nPyArray_CopyAndTranspose(PyObject *op) \n{\n\tPyObject *ret, *arr;\n\tint nd;\n\tintp dims[2];\n\tintp i,j;\n\tint elsize, str2;\n\tchar *iptr;\n\tchar *optr;\n\n\t/* make sure it is well-behaved */\n\tarr = PyArray_FromAny(op, NULL, 0, 0, CARRAY_FLAGS);\n\tnd = PyArray_NDIM(arr);\n\tif (nd == 1) {     /* we will give in to old behavior */\n\t\tret = PyArray_Copy((PyArrayObject *)arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\t\t\n\t}\n\telse if (nd != 2) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Only 2-d arrays are allowed.\");\n\t\treturn NULL;\n\t}\n\n\t/* Now construct output array */\n\tdims[0] = PyArray_DIM(arr,1);\n\tdims[1] = PyArray_DIM(arr,0);\n\telsize = PyArray_ITEMSIZE(arr);\n\n\tret = PyArray_New(arr->ob_type, 2, dims, PyArray_TYPE(arr),\n\t\t\t  NULL, NULL, elsize, 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; i<dims[0]; i++) {\n\t\tiptr = PyArray_DATA(arr) + i*elsize;\n\t\tfor (j=0; j<dims[1]; j++) {\n\t\t\t/* optr[i,j] = iptr[j,i] */\n\t\t\tmemcpy(optr, iptr, elsize);\n\t\t\toptr += elsize;\n\t\t\tiptr += str2;\n\t\t}\n\t}\n\tPy_DECREF(arr);\n\treturn ret;\n}\n \nstatic PyObject *\nPyArray_Correlate(PyObject *op1, PyObject *op2, int mode) \n{\n\tPyArrayObject *ap1, *ap2, *ret;\n\tintp length;\n\tint i, n1, n2, n, n_left, n_right;\n\tint typenum;\n\tint is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tPyArray_DotFunc *dot;\n\tPyArray_Typecode typec = {0,0,0};\n\t\n\ttypenum = PyArray_ObjectType(op1, 0);  \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\n\ttypec.type_num = typenum;\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_FromAny(op1, &typec, 1, 1,\n\t\t\t\t\t       DEFAULT_FLAGS);\n\tif (ap2 == NULL) goto fail;\n\t\n\tn1 = ap1->dimensions[ap1->nd-1];\n\tn2 = ap2->dimensions[ap2->nd-1];\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 = (int)(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\t\n\tret = (PyArrayObject *)PyArray_New(ap1->ob_type, 1,\n\t\t\t\t\t   &length, typenum, \n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)ap1);\n\tif (ret == NULL) goto fail;\n\n\t\n\tdot = ret->descr->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->itemsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; i<n_left; i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tn++;\n\t\tip2 -= is2;\n\t\top += os;\n\t}\n\tfor(i=0; i<(n1-n2+1); i++) {\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tfor(i=0; i<n_right; i++) {\n\t\tn--;\n\t\tdot(ip1, is1, ip2, is2, op, n, ret);\n\t\tip1 += is1;\n\t\top += os;\n\t}\n\tif (PyErr_Occurred()) goto fail;\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\nstatic PyObject *\nPyArray_ArgMin(PyArrayObject *ap, int axis) \n{\n\tPyObject *obj, *new, *ret;\n\n\tif (PyArray_ISFLEXIBLE(ap)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"argmax is unsupported for this type.\");\n\t\treturn NULL;\n\t}\n\telse if (PyArray_ISUNSIGNED(ap)) \n\t\tobj = PyInt_FromLong((long) -1);\n\t\n\telse if (PyArray_TYPE(ap)==PyArray_BOOL) \n\t\tobj = PyInt_FromLong((long) 1);\n\t\n\telse \n\t\tobj = PyInt_FromLong((long) 0);\n\t\n\tnew = PyNumber_Subtract(obj, (PyObject *)ap);\n\tif (new == NULL) return NULL;\n\n\tPy_DECREF(obj);\n\tret = PyArray_ArgMax((PyArrayObject *)new, axis);\n\tPy_DECREF(new);\n\treturn ret;\n}\n\nstatic PyObject *\nPyArray_Max(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.maximum, axis, \n\t\t\t\t\t    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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    PyArray_NOTYPE);\n\tPy_DECREF(arr);\n\treturn ret;\t    \n}\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\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->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->itemsize;\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; i<n; i++, ip+=elsize*m) {\n\t\targ_func(ip, m, rptr, ap);\n\t\trptr += 1;\n\t}\n\tPy_DECREF(ap);\n\n\tSWAPBACK(op, rp);     /* op now contains the return */\n  \n\treturn (PyObject *)op;\n\t\n fail:\n\tPy_DECREF(ap);\n\tPy_XDECREF(rp);\n\treturn NULL;\n}  \n\n\nstatic PyObject *\nPyArray_Take(PyArrayObject *self0, PyObject *indices0, int axis) {\n        PyArrayObject *self, *indices, *ret;\n        intp nd, i, j, n, m, max_item, tmp, chunk;\n\tintp shape[MAX_DIMS];\n        char *src, *dest;\n\t\n        indices = ret = NULL;\n\tself = (PyAO *)_check_axis(self0, &axis, CARRAY_FLAGS);\n        if (self == NULL) return NULL;\n\t\n        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, \n\t\t\t\t\t\t\t\tPyArray_INTP, \n\t\t\t\t\t\t\t\t1, 0);\n        if (indices == NULL) goto fail;\n\t\n        n = m = chunk = 1;\n        nd = self->nd + 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        ret = (PyArrayObject *)PyArray_New(self->ob_type, nd, shape, \n\t\t\t\t\t   self->descr->type_num,\n\t\t\t\t\t   NULL, NULL, 0, 0, \n                                           (PyObject *)self);\n\t\n        if (ret == NULL) goto fail;\n\t\n        max_item = self->dimensions[axis];\n        chunk = chunk * ret->itemsize;\n        src = self->data;\n        dest = ret->data;\n\t\n        for(i=0; i<n; i++) {\n                for(j=0; j<m; j++) {\n                        tmp = ((intp *)(indices->data))[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\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject *indices0, PyObject* values0) \n{\n        PyArrayObject  *indices, *values;\n        int i, chunk, ni, max_item, nv, tmp; \n        char *src, *dest;\n\n        indices = NULL;\n        values = NULL;\n\n        if (!PyArray_Check(self)) {\n                PyErr_SetString(PyExc_ValueError, \"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->itemsize;\n\n        indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);\n        if (indices == NULL) goto fail;\n        ni = PyArray_SIZE(indices);\n\n        values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, self->descr->type_num, \n\t\t\t\t\t     0, 0);\n        if (values == NULL) goto fail;\n        nv = PyArray_SIZE(values);\n        if (nv > 0) { /* nv == 0 for a null array */\n                for(i=0; i<ni; i++) {\n                        src = values->data + 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        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\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject *mask0, PyObject* values0) \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_ValueError, \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->itemsize;\n\n        mask = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(mask0, PyArray_BOOL, 0, 0);\n        if (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\t\tfor(i=0; i<ni; i++) {\n\t\t\tsrc = values->data + chunk * (i % nv);\n\t\t\ttmp = ((Bool *)(mask->data))[i];\n\t\t\tif (tmp) {\n\t\t\t\tmemmove(dest + i * chunk, src, chunk);\n\t\t\t\tif (thistype == PyArray_OBJECT)\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\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    \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\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{\n\tif (PyObject_IsTrue(object)) *val=TRUE;\n\telse *val=FALSE;\n\tif (PyErr_Occurred()) return PY_FAIL;\n\treturn PY_SUCCEED;\n}\n\n\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (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\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n        int buflen;\n\n        buf->ptr = NULL;\n        buf->flags = WRITEABLE;\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\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) goto fail;\n        return PY_SUCCEED;\n\n fail:\n\tPyDimMem_FREE(seq->ptr);\n\treturn PY_FAIL;\n}\n\n/* This function takes a Python object representing a type and converts it \n   to a C type_num and an itemsize (elements of PyArray_Typecode structure)\n   \n   Many objects can be used to represent a type.\n */\n\nstatic int\nPyArray_TypecodeConverter(PyObject *obj, PyArray_Typecode *at)\n{\n        char *type;\n        PyArray_Descr *descr;\n        int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item, *attr=NULL;\n\n\tat->itemsize = 0;\n        if (obj == Py_None) {\n                at->type_num = PyArray_NOTYPE;\n                return PY_SUCCEED;\n        }\n\n        if (PyType_Check(obj) && PyType_IsSubtype((PyTypeObject *)obj, \n                                                  &PyGenericArrType_Type)) {\n                PyArray_TypecodeFromTypeObject(obj, at);\n                return PY_SUCCEED;\n        }\n\n\n\t/* type object could be an array */\n\tif (PyArray_Check(obj)) {\n\t\tat->type_num = PyArray_TYPE(obj);\n\t\tat->itemsize = PyArray_ITEMSIZE(obj);\n\t\treturn PY_SUCCEED;\n\t}\n\n\t/* or an array scalar */\n        if (PyArray_IsScalar(obj, Generic)) {\n                PyArray_TypecodeFromScalar(obj, at);\n                return PY_SUCCEED;\n        }\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);\t\t\n\t\tif (len > 0) {\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tif (len > 1) {\n\t\t\tat->itemsize = atoi(type+1);\n\t\t\t/* When specifying length of UNICODE\n\t\t\t   the number of characters is given to match \n\t\t\t   the STRING interface.  Each character can be\n\t\t\t   more than one byte and itemsize must be\n\t\t\t   the number of bytes.\n\t\t\t*/\n\t\t\tif (check_num == PyArray_UNICODELTR ||\t\\\n\t\t\t    check_num == PyArray_UNICODE) \n\t\t\t  at->itemsize *= sizeof(Py_UNICODE);\n\n\t\t\t/* Support for generic processing */\n\t\t\telse if ((check_num != PyArray_STRINGLTR) &&\n\t\t\t\t (check_num != PyArray_VOIDLTR) &&\n\t\t\t\t (check_num != PyArray_STRING) &&\n\t\t\t\t (check_num != PyArray_VOID)) {\n\t\t\t\tcheck_num = \\\n\t\t\t\t\tPyArray_TypestrConvert(at->itemsize,\n\t\t\t\t\t\t\t       check_num);\n\t\t\t        at->itemsize = 0;\n\t\t\t\tif (check_num == PyArray_NOTYPE) goto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Arbitray object with dtypenum and itemsize attributes. */\n\telse if (PyObject_HasAttrString(obj, \"dtypenum\") && \n\t    PyObject_HasAttrString(obj, \"itemsize\")) {\n\t\tattr = PyObject_GetAttrString(obj, \"dtypenum\");\n\t\tcheck_num = PyInt_AsLong(attr);\n\t\tif (PyErr_Occurred()) {  /* not an integer, try character */\n\t\t\tPyErr_Clear();\n\t\t\ttype = PyString_AsString(attr);\n\t\t\tcheck_num = (int) type[0];\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tif (!PyErr_Occurred()) {\n\t\t\tattr = PyObject_GetAttrString(obj, \"itemsize\");\n\t\t\tat->itemsize = PyInt_AsLong(attr);\n\t\t\tPy_XDECREF(attr);\n\t\t}\t\t\t\n\t}\t\t\n\telse if (PyType_Check(obj)) {\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 *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\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                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}\t\n        else { /* Default -- try integer conversion */\n                check_num = PyInt_AsLong(obj);\n\t}\n\n\tif (PyErr_Occurred()) goto fail;\n\n\t/*\n\tif (check_num == PyArray_NOTYPE) return PY_FAIL;\n\t*/\n\tif (check_num == PyArray_NOTYPE) {\n\t\tat->type_num = PyArray_NOTYPE;\n\t\tat->itemsize = 0;\n\t\treturn PY_SUCCEED;\n\t}\n\n        if ((descr = PyArray_DescrFromType(check_num))==NULL) {\n\t\t/* Now check to see if the object is registered\n\t\t   in typeDict */\n\t\tif (typeDict != NULL) {\n\t\t\titem = PyDict_GetItem(typeDict, obj);\n\t\t\tif (item) {\n\t\t\t\tPyArray_TypecodeFromTypeObject(obj, at);\n\t\t\t\tPyErr_Clear();\n\t\t\t\treturn PY_SUCCEED;\n\t\t\t}\n\t\t}\n                return PY_FAIL;\n\t}\n\t\n        at->type_num = descr->type_num;\n\tif (at->itemsize == 0) at->itemsize = descr->elsize;\n\t\n        return PY_SUCCEED;\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\treturn PY_FAIL;\n}\t\n\n\n/* This function returns true if the two typecodes are \n   equivalent (same basic kind and same itemsize).\n*/\n\nstatic Bool\nPyArray_EquivalentTypes(PyArray_Typecode *typ1, PyArray_Typecode *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->itemsize;\n\tregister int size2=typ2->itemsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typenum1==typenum2) return TRUE;\n\n\t/* If we are here then size1 == size2 */\n\tif (typenum1 < PyArray_FLOAT) {\n\t\tif (PyTypeNum_ISBOOL(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISBOOL(typenum2));\n\t\telse if (PyTypeNum_ISUNSIGNED(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISUNSIGNED(typenum2));\n\t\telse \n\t\t\treturn (Bool)(PyTypeNum_ISSIGNED(typenum2));\n\t}\n\telse {\n\t\tif (PyTypeNum_ISFLOAT(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISFLOAT(typenum2));\n\t\telse if (PyTypeNum_ISCOMPLEX(typenum1))\n\t\t\treturn (Bool)(PyTypeNum_ISCOMPLEX(typenum2));\n\t}\n\t/* Default size1 != size2 and typenum1 != typenum2 */\n\treturn FALSE;\t\n}\n\nstatic Bool \nPyArray_EquivArrTypes(PyArrayObject *a1, PyArrayObject *a2)\n{\n        PyArray_Typecode type1={0,0,0};\n        PyArray_Typecode type2={0,0,0};\n\n\ttype1.type_num = PyArray_TYPE(a1);\n\ttype2.type_num = PyArray_TYPE(a2);\n\ttype1.itemsize = PyArray_ITEMSIZE(a1);\n\ttype2.itemsize = PyArray_ITEMSIZE(a2);\n\t\t\t\n        return PyArray_EquivalentTypes(&type1, &type2);\n}\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_Typecode type = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode oldtype = {PyArray_NOTYPE, 0, 0};\n\tint type_num;\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_TypecodeConverter,\n                                        &type, \n\t\t\t\t\tPyArray_BoolConverter, &copy, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n                                        PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\ttype_num = type.type_num;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) && PyBigArray_CheckExact(op)) && \\\n            (copy==0) &&                                             \\\n\t    (fortran == PyArray_CHKFLAGS(op, FORTRAN))) {\n\t\tif (type_num == PyArray_NOTYPE) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t\t/* One more chance */\n\t\toldtype.type_num = PyArray_TYPE(op);\n\t\toldtype.itemsize = PyArray_ITEMSIZE(op);\n\t\tif (PyArray_EquivalentTypes(&oldtype, &type)) {\n\t\t\tPy_INCREF(op);\n\t\t\treturn op;\n\t\t}\n\t}\n\n\ttype.fortran = fortran; \n\tif (copy) {\n\t\tflags = ENSURECOPY;\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\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n        \n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Empty(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypestr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. typestr must be a valid data typestr (complete with < > or |).  If dtypestr is object, 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[] = {\"dtypestr\",\"obj\", NULL};\n\tPyArray_Typecode typecode;\n\tPyObject *obj=NULL;\n\tchar *typestr;\n\tint typestrlen;\n\tint swap, alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"z#|O\",\n\t\t\t\t\t kwlist, &typestr, &typestrlen,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\n\tif (_array_typecode_fromstr(typestr, &swap, &typecode) < 0) \n\t\treturn NULL;\n\t\n\tif (typecode.itemsize == 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\tswap = 0;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = malloc(typecode.itemsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode.itemsize);\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_ValueError, \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.itemsize) {\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.type_num,\n\t\t\t     typecode.itemsize, swap); \n\n\t/* free dptr which contains zeros */\n\tif (alloc) free(dptr);\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Typecode *type)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, nd, dims, \n\t\t\t\t\t   type->type_num,\n\t\t\t\t\t   NULL, NULL, type->itemsize, \n\t\t\t\t\t   type->fortran, NULL);\n\tif (ret == NULL) return NULL;\n        \n\tn = PyArray_SIZE(ret);\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 {\t\t\n\t\tmemset(ret->data, 0, n*(ret->itemsize));\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=intp,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_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n        PyArray_Dims shape;\n\tBool fortran = FALSE;\t\n        PyObject *ret;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &shape, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\treturn NULL;\n\t\n\ttypecode.fortran = fortran;\n        if (typecode.type_num ==PyArray_NOTYPE) \n\t\ttypecode.type_num = PyArray_INTP;\n                \n\tret = PyArray_Zeros(shape.len, shape.ptr, &typecode);        \n        PyDimMem_FREE(shape.ptr);\n        return 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\nstatic char doc_fromString[] = \"fromstring(string, dtype=intp, count=-1, swap=False) 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\tPyArrayObject *ret; \n\tchar *data;\n\tlonglong nin=-1;\n\tintp s, n;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", \"swap\",NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint itemsize;\n\tint swapped=FALSE;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&LO&\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &swapped)) {\n\t\treturn NULL;\n\t}\n\t\n\tn = (intp) nin;\n\n\titemsize = type.itemsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize.\");\n\t\treturn NULL;\n\t}\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\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\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\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype.type_num, NULL, \n\t\t\t\t\t\tNULL, itemsize, 0,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*ret->itemsize);\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPyArray_INCREF(ret);\n\treturn (PyObject *)ret;\n}\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\nstatic int\n_fill_in_itemsize(PyArray_Typecode *typecode)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(typecode->type_num);\n\tif (descr==NULL) return -1;\n\ttypecode->itemsize = descr->elsize;\n\treturn 0;\n}\n\n\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Typecode *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\n\tif (typecode->itemsize == 0) {\n\t\tif (_fill_in_itemsize(typecode) < 0) \n\t\t\treturn NULL;\n\t}\n\n\tif (num == -1 && sep == NULL) {  /* 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\tfseek(fp, (long) start, SEEK_SET);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \"Could not seek in file.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif (typecode->itemsize == 0) {\n\t\t\ttypecode->itemsize = numbytes;\n\t\t\tnum = 1;\n\t\t}\n\t\telse {\n\t\t\tnum = numbytes / typecode->itemsize;\n\t\t}\n\t}\n\t\n\tif (sep==NULL) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &num, \n\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t typecode->itemsize, 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->itemsize, 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 = PyArray_DescrFromType(typecode->type_num)->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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &num, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\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, r->itemsize, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->itemsize;\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 *)PyArray_New(&PyArray_Type, 1, \n\t\t\t\t\t\t\t &size, \n\t\t\t\t\t\t\t typecode->type_num,\n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t typecode->itemsize, \n\t\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->itemsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, r->itemsize, 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->itemsize;\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->itemsize);\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->itemsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=intp, count=-1, sep='')\\n\"\\\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_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\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, \"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\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Typecode *type, \n\t\t   intp count, int swapped) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\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\treturn NULL;\n\t}\n\tif (type->itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Itemsize cannot be zero in type\");\n\t\treturn NULL;\n\t}\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\treturn NULL;\n\t\t}\n\t}\n\ts = (intp)ts;\t\n\tn = (intp)count;\n\titemsize = type->itemsize;\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\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\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &n, \n\t\t\t\t\t\ttype->type_num, NULL, \n\t\t\t\t\t\tdata, itemsize, DEFAULT_FLAGS,\n\t\t\t\t\t\tNULL)) == NULL)\n\t\treturn NULL;\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\tif (swapped) ret->flags &= ~NOTSWAPPED;\n\tPy_INCREF(buf);\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret; \t\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=intp, count=-1, swap=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 the buffer has data that is out\\n\" \\\n\t\"   not in machine byte-order, than set swap=1.  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;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", \n\t\t\t\t \"swap\", NULL};\n\tPyArray_Typecode type = {PyArray_INTP, sizeof(intp), 0};\n\tint swapped=0;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Li\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_TypecodeConverter, &type,\n\t\t\t\t\t &nin, &swapped)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromBuffer(obj, &type, (intp)nin, swapped);\n}\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\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length, i;\n\tPyObject *range;\n\tchar *rptr;\n\tint elsize, type;\n\tdouble value;\n\tPyArray_Descr *dbl_descr;\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\tdbl_descr = PyArray_DescrFromType(PyArray_DOUBLE);\n    \n\trptr = ((PyArrayObject *)range)->data;\n\telsize = ((PyArrayObject *)range)->itemsize;\n\ttype = ((PyArrayObject *)range)->descr->type_num;\n\tfor (i=0; i < length; i++) {\n\t\tvalue = start + i*step;\n\t\tdbl_descr->cast[type]((char*)&value, rptr, 1, NULL, \n\t\t\t\t      (PyArrayObject *)range);\n\t\trptr += elsize;\n\t}\n    \n\treturn range;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=intp)\\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=Py_None, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tdouble start, stop, step;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0};\n\tint type_num;\n\tint deftype = PyArray_INTP;\n\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_TypecodeConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\tdeftype = PyArray_ObjectType(o_start, deftype);\n\tif (o_stop != Py_None) {\n\t\tdeftype = PyArray_ObjectType(o_stop, deftype);\n\t}\n\tif (o_step != NULL) {\n\t\tdeftype = PyArray_ObjectType(o_step, deftype);\n\t}\n\n\ttype_num = typecode.type_num;\n\tif (type_num == PyArray_NOTYPE) {\n\t\ttype_num = deftype;\n\t}\n\n\tstart = PyFloat_AsDouble(o_start);\n\tif error_converting(start) return NULL;\n\n\tif (o_step == NULL) {\n\t\tstep = 1;\n\t}\n\telse {\n\t\tstep = PyFloat_AsDouble(o_step);\n\t\tif error_converting(step) return NULL;\n\t}\n\n\tif (o_stop == Py_None) {\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\telse {\n\t\tstop = PyFloat_AsDouble(o_stop);\n\t\tif error_converting(stop) return NULL;\n\t}\n\n\treturn PyArray_Arange(start, stop, step, type_num);\n}\n\n#undef _ARET\n\n/*****\n      static char doc_arrayMap[] = \"arrayMap(func, [a1,...,an])\";\n\n      static PyObject *array_arrayMap(PyObject *dummy, PyObject *args) {\n      PyObject *shape, *a0;\n  \n      if (PyArg_ParseTuple(args, \"OO\", &a0, &shape) == NULL) return NULL;\n\t\n      return PyArray_Map(a0, shape);\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\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 (PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"One or more objects is not callable.\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\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\tif ((x==NULL) || (y==NULL)) {\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\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\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, n_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_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_Typecode d1={PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode d2={PyArray_NOTYPE, 0, 0};\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_TypecodeConverter, &d1,\n\t\t\t\t\tPyArray_TypecodeConverter, &d2))\n\t\treturn NULL;\n\tif (d1.type_num == PyArray_NOTYPE || \\\n\t    d2.type_num == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types. \"\\\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 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{\"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/*  {\"arrayMap\",\t(PyCFunction)array_arrayMap, \n\t    METH_VARARGS, doc_arrayMap},*/\n\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_Tyupe\",  \\\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(Numeric, Generic);\n        SINGLE_INHERIT(Integer, Numeric);\n        SINGLE_INHERIT(Inexact, Numeric);\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        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        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        SINGLE_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\t   \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, \"NOTSWAPPED\", s=PyInt_FromLong(NOTSWAPPED));\n        Py_DECREF(s);\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\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n        \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n                return; \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(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\n        set_flaginfo(d);\n\n\tif (set_typeinfo(d) == 0) \n                return;  /* otherwise there is an error */\n\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": "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": 51,
                        "end_line": 56,
                        "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": 59,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 68,
                        "end_line": 80,
                        "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": 83,
                        "end_line": 90,
                        "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_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 9,
                        "token_count": 245,
                        "parameters": [
                            "self",
                            "type"
                        ],
                        "start_line": 93,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Ravel",
                        "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 87,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 144,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Flatten",
                        "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 32,
                        "complexity": 5,
                        "token_count": 162,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 161,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 202,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Newshape",
                        "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)",
                        "filename": "multiarraymodule.c",
                        "nloc": 68,
                        "complexity": 15,
                        "token_count": 366,
                        "parameters": [
                            "self",
                            "newdims"
                        ],
                        "start_line": 219,
                        "end_line": 298,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Squeeze",
                        "long_name": "PyArray_Squeeze( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 4,
                        "token_count": 192,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 306,
                        "end_line": 337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 32,
                        "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": 341,
                        "end_line": 362,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 43,
                        "complexity": 12,
                        "token_count": 433,
                        "parameters": [
                            "self",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 365,
                        "end_line": 420,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "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": 424,
                        "end_line": 434,
                        "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": 437,
                        "end_line": 447,
                        "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": 450,
                        "end_line": 460,
                        "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": 463,
                        "end_line": 474,
                        "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": 477,
                        "end_line": 488,
                        "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": 491,
                        "end_line": 502,
                        "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": 506,
                        "end_line": 526,
                        "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": 50,
                        "complexity": 13,
                        "token_count": 403,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 529,
                        "end_line": 587,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Clip",
                        "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 6,
                        "token_count": 241,
                        "parameters": [
                            "self",
                            "min",
                            "max"
                        ],
                        "start_line": 590,
                        "end_line": 623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Conjugate",
                        "long_name": "PyArray_Conjugate( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 9,
                        "token_count": 225,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 626,
                        "end_line": 662,
                        "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": 665,
                        "end_line": 675,
                        "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": 106,
                        "complexity": 24,
                        "token_count": 808,
                        "parameters": [
                            "self",
                            "offset",
                            "axis1",
                            "axis2"
                        ],
                        "start_line": 678,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_AsCArray",
                        "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , int type_num)",
                        "filename": "multiarraymodule.c",
                        "nloc": 55,
                        "complexity": 13,
                        "token_count": 432,
                        "parameters": [
                            "op",
                            "ptr",
                            "dims",
                            "nd",
                            "type_num"
                        ],
                        "start_line": 816,
                        "end_line": 872,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 57,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_As1D",
                        "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "typecode"
                        ],
                        "start_line": 877,
                        "end_line": 885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 9,
                        "complexity": 2,
                        "token_count": 81,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "d2",
                            "typecode"
                        ],
                        "start_line": 889,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 904,
                        "end_line": 915,
                        "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": 919,
                        "end_line": 947,
                        "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": 114,
                        "complexity": 24,
                        "token_count": 771,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 956,
                        "end_line": 1084,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 129,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SwapAxes",
                        "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 37,
                        "complexity": 12,
                        "token_count": 227,
                        "parameters": [
                            "ap",
                            "a1",
                            "a2"
                        ],
                        "start_line": 1087,
                        "end_line": 1126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Transpose",
                        "long_name": "PyArray_Transpose( PyArrayObject * ap , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 49,
                        "complexity": 15,
                        "token_count": 403,
                        "parameters": [
                            "ap",
                            "op"
                        ],
                        "start_line": 1130,
                        "end_line": 1189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "qsortCompare",
                        "long_name": "qsortCompare( const * a , const * b)",
                        "filename": "multiarraymodule.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 1408,
                        "end_line": 1411,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 7,
                        "token_count": 250,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1433,
                        "end_line": 1482,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "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": 63,
                        "parameters": [
                            "ip1",
                            "ip2"
                        ],
                        "start_line": 1488,
                        "end_line": 1496,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "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": 1561,
                        "end_line": 1596,
                        "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": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "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": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 101,
                        "complexity": 20,
                        "token_count": 783,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1884,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 125,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyAndTranspose",
                        "long_name": "PyArray_CopyAndTranspose( PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 44,
                        "complexity": 6,
                        "token_count": 278,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 1887,
                        "end_line": 1938,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 13,
                        "token_count": 625,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1941,
                        "end_line": 2039,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 99,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgMin",
                        "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 5,
                        "token_count": 138,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2042,
                        "end_line": 2067,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Max",
                        "long_name": "PyArray_Max( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2070,
                        "end_line": 2081,
                        "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": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2084,
                        "end_line": 2095,
                        "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": 2098,
                        "end_line": 2121,
                        "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": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2125,
                        "end_line": 2182,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2186,
                        "end_line": 2258,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2261,
                        "end_line": 2313,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2316,
                        "end_line": 2378,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 2390,
                        "end_line": 2402,
                        "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": 7,
                        "complexity": 3,
                        "token_count": 42,
                        "parameters": [
                            "object",
                            "val"
                        ],
                        "start_line": 2405,
                        "end_line": 2411,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypestrConvert",
                        "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)",
                        "filename": "multiarraymodule.c",
                        "nloc": 90,
                        "complexity": 33,
                        "token_count": 284,
                        "parameters": [
                            "itemsize",
                            "gentype"
                        ],
                        "start_line": 2415,
                        "end_line": 2524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "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": 2539,
                        "end_line": 2564,
                        "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": 35,
                        "complexity": 10,
                        "token_count": 186,
                        "parameters": [
                            "obj",
                            "seq"
                        ],
                        "start_line": 2576,
                        "end_line": 2612,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypecodeConverter",
                        "long_name": "PyArray_TypecodeConverter( PyObject * obj , PyArray_Typecode * at)",
                        "filename": "multiarraymodule.c",
                        "nloc": 108,
                        "complexity": 33,
                        "token_count": 639,
                        "parameters": [
                            "obj",
                            "at"
                        ],
                        "start_line": 2621,
                        "end_line": 2759,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 139,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivalentTypes",
                        "long_name": "PyArray_EquivalentTypes( PyArray_Typecode * typ1 , PyArray_Typecode * typ2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 24,
                        "complexity": 8,
                        "token_count": 162,
                        "parameters": [
                            "typ1",
                            "typ2"
                        ],
                        "start_line": 2767,
                        "end_line": 2794,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivArrTypes",
                        "long_name": "PyArray_EquivArrTypes( PyArrayObject * a1 , PyArrayObject * a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 80,
                        "parameters": [
                            "a1",
                            "a2"
                        ],
                        "start_line": 2797,
                        "end_line": 2808,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 282,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2830,
                        "end_line": 2881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Empty",
                        "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 99,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2884,
                        "end_line": 2900,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_empty",
                        "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2906,
                        "end_line": 2930,
                        "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": 56,
                        "complexity": 11,
                        "token_count": 290,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2935,
                        "end_line": 2999,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 65,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Zeros",
                        "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 20,
                        "complexity": 3,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 3003,
                        "end_line": 3025,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_zeros",
                        "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 22,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3031,
                        "end_line": 3055,
                        "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": 3062,
                        "end_line": 3071,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromString",
                        "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 8,
                        "token_count": 283,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3076,
                        "end_line": 3131,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fill_in_itemsize",
                        "long_name": "_fill_in_itemsize( PyArray_Typecode * typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "typecode"
                        ],
                        "start_line": 3146,
                        "end_line": 3153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromFile",
                        "long_name": "PyArray_FromFile( FILE * fp , PyArray_Typecode * typecode , intp num , char * sep)",
                        "filename": "multiarraymodule.c",
                        "nloc": 113,
                        "complexity": 23,
                        "token_count": 682,
                        "parameters": [
                            "fp",
                            "typecode",
                            "num",
                            "sep"
                        ],
                        "start_line": 3157,
                        "end_line": 3284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 128,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromfile",
                        "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 221,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3302,
                        "end_line": 3337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromBuffer",
                        "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Typecode * type , intp count , int swapped)",
                        "filename": "multiarraymodule.c",
                        "nloc": 58,
                        "complexity": 11,
                        "token_count": 306,
                        "parameters": [
                            "buf",
                            "type",
                            "count",
                            "swapped"
                        ],
                        "start_line": 3340,
                        "end_line": 3403,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frombuffer",
                        "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 16,
                        "complexity": 2,
                        "token_count": 115,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3417,
                        "end_line": 3434,
                        "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": 3441,
                        "end_line": 3452,
                        "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": 3459,
                        "end_line": 3465,
                        "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": 3472,
                        "end_line": 3478,
                        "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": 3482,
                        "end_line": 3488,
                        "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": 3492,
                        "end_line": 3501,
                        "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": 29,
                        "complexity": 4,
                        "token_count": 229,
                        "parameters": [
                            "start",
                            "stop",
                            "step",
                            "type_num"
                        ],
                        "start_line": 3505,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_arange",
                        "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 10,
                        "token_count": 258,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 3544,
                        "end_line": 3592,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 11,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3612,
                        "end_line": 3623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "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": 3,
                        "token_count": 67,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3629,
                        "end_line": 3646,
                        "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": 29,
                        "complexity": 8,
                        "token_count": 226,
                        "parameters": [
                            "condition",
                            "x",
                            "y"
                        ],
                        "start_line": 3650,
                        "end_line": 3686,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "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": 3694,
                        "end_line": 3702,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3708,
                        "end_line": 3719,
                        "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": 23,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3726,
                        "end_line": 3750,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 3810,
                        "end_line": 3919,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "set_flaginfo",
                        "long_name": "set_flaginfo( PyObject * d)",
                        "filename": "multiarraymodule.c",
                        "nloc": 23,
                        "complexity": 1,
                        "token_count": 171,
                        "parameters": [
                            "d"
                        ],
                        "start_line": 3924,
                        "end_line": 3950,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 341,
                        "parameters": [],
                        "start_line": 3955,
                        "end_line": 4033,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 79,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "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": 51,
                        "end_line": 56,
                        "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": 59,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 68,
                        "end_line": 80,
                        "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": 83,
                        "end_line": 90,
                        "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_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 9,
                        "token_count": 245,
                        "parameters": [
                            "self",
                            "type"
                        ],
                        "start_line": 93,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Ravel",
                        "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 14,
                        "complexity": 4,
                        "token_count": 87,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 144,
                        "end_line": 158,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Flatten",
                        "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)",
                        "filename": "multiarraymodule.c",
                        "nloc": 32,
                        "complexity": 5,
                        "token_count": 162,
                        "parameters": [
                            "a",
                            "fortran"
                        ],
                        "start_line": 161,
                        "end_line": 194,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 202,
                        "end_line": 211,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Newshape",
                        "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)",
                        "filename": "multiarraymodule.c",
                        "nloc": 68,
                        "complexity": 15,
                        "token_count": 366,
                        "parameters": [
                            "self",
                            "newdims"
                        ],
                        "start_line": 219,
                        "end_line": 298,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Squeeze",
                        "long_name": "PyArray_Squeeze( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 4,
                        "token_count": 192,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 306,
                        "end_line": 337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 32,
                        "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": 341,
                        "end_line": 362,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 43,
                        "complexity": 12,
                        "token_count": 433,
                        "parameters": [
                            "self",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 365,
                        "end_line": 420,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "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": 424,
                        "end_line": 434,
                        "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": 437,
                        "end_line": 447,
                        "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": 450,
                        "end_line": 460,
                        "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": 463,
                        "end_line": 474,
                        "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": 477,
                        "end_line": 488,
                        "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": 491,
                        "end_line": 502,
                        "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": 506,
                        "end_line": 526,
                        "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": 50,
                        "complexity": 13,
                        "token_count": 403,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 529,
                        "end_line": 587,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Clip",
                        "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)",
                        "filename": "multiarraymodule.c",
                        "nloc": 30,
                        "complexity": 6,
                        "token_count": 241,
                        "parameters": [
                            "self",
                            "min",
                            "max"
                        ],
                        "start_line": 590,
                        "end_line": 623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Conjugate",
                        "long_name": "PyArray_Conjugate( PyArrayObject * self)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 9,
                        "token_count": 225,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 626,
                        "end_line": 662,
                        "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": 665,
                        "end_line": 675,
                        "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": 106,
                        "complexity": 24,
                        "token_count": 808,
                        "parameters": [
                            "self",
                            "offset",
                            "axis1",
                            "axis2"
                        ],
                        "start_line": 678,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 122,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_AsCArray",
                        "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , int type_num)",
                        "filename": "multiarraymodule.c",
                        "nloc": 55,
                        "complexity": 13,
                        "token_count": 432,
                        "parameters": [
                            "op",
                            "ptr",
                            "dims",
                            "nd",
                            "type_num"
                        ],
                        "start_line": 816,
                        "end_line": 872,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 57,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_As1D",
                        "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "typecode"
                        ],
                        "start_line": 877,
                        "end_line": 885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 9,
                        "complexity": 2,
                        "token_count": 81,
                        "parameters": [
                            "op",
                            "ptr",
                            "d1",
                            "d2",
                            "typecode"
                        ],
                        "start_line": 889,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 904,
                        "end_line": 915,
                        "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": 919,
                        "end_line": 947,
                        "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": 114,
                        "complexity": 24,
                        "token_count": 771,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 956,
                        "end_line": 1084,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 129,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SwapAxes",
                        "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 37,
                        "complexity": 12,
                        "token_count": 227,
                        "parameters": [
                            "ap",
                            "a1",
                            "a2"
                        ],
                        "start_line": 1087,
                        "end_line": 1126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Transpose",
                        "long_name": "PyArray_Transpose( PyArrayObject * ap , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 49,
                        "complexity": 15,
                        "token_count": 403,
                        "parameters": [
                            "ap",
                            "op"
                        ],
                        "start_line": 1130,
                        "end_line": 1189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Repeat",
                        "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 75,
                        "complexity": 15,
                        "token_count": 520,
                        "parameters": [
                            "aop",
                            "op",
                            "axis"
                        ],
                        "start_line": 1192,
                        "end_line": 1284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 93,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Choose",
                        "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 18,
                        "token_count": 650,
                        "parameters": [
                            "ip",
                            "op"
                        ],
                        "start_line": 1288,
                        "end_line": 1400,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 113,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "qsortCompare",
                        "long_name": "qsortCompare( const * a , const * b)",
                        "filename": "multiarraymodule.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 28,
                        "parameters": [
                            "a",
                            "b"
                        ],
                        "start_line": 1408,
                        "end_line": 1411,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 36,
                        "complexity": 7,
                        "token_count": 250,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1433,
                        "end_line": 1482,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "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": 63,
                        "parameters": [
                            "ip1",
                            "ip2"
                        ],
                        "start_line": 1488,
                        "end_line": 1496,
                        "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)",
                        "filename": "multiarraymodule.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 350,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 1499,
                        "end_line": 1558,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "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": 1561,
                        "end_line": 1596,
                        "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": 223,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1599,
                        "end_line": 1644,
                        "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": 83,
                        "complexity": 17,
                        "token_count": 657,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1652,
                        "end_line": 1755,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 104,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MatrixProduct",
                        "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 101,
                        "complexity": 20,
                        "token_count": 783,
                        "parameters": [
                            "op1",
                            "op2"
                        ],
                        "start_line": 1760,
                        "end_line": 1884,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 125,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyAndTranspose",
                        "long_name": "PyArray_CopyAndTranspose( PyObject * op)",
                        "filename": "multiarraymodule.c",
                        "nloc": 44,
                        "complexity": 6,
                        "token_count": 278,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 1887,
                        "end_line": 1938,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Correlate",
                        "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 89,
                        "complexity": 13,
                        "token_count": 625,
                        "parameters": [
                            "op1",
                            "op2",
                            "mode"
                        ],
                        "start_line": 1941,
                        "end_line": 2039,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 99,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArgMin",
                        "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 5,
                        "token_count": 138,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2042,
                        "end_line": 2067,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Max",
                        "long_name": "PyArray_Max( PyArrayObject * ap , int axis)",
                        "filename": "multiarraymodule.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2070,
                        "end_line": 2081,
                        "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": 67,
                        "parameters": [
                            "ap",
                            "axis"
                        ],
                        "start_line": 2084,
                        "end_line": 2095,
                        "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": 2098,
                        "end_line": 2121,
                        "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": 322,
                        "parameters": [
                            "op",
                            "axis"
                        ],
                        "start_line": 2125,
                        "end_line": 2182,
                        "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": 62,
                        "complexity": 12,
                        "token_count": 468,
                        "parameters": [
                            "self0",
                            "indices0",
                            "axis"
                        ],
                        "start_line": 2186,
                        "end_line": 2258,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 73,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Put",
                        "long_name": "PyArray_Put( PyArrayObject * self , PyObject * indices0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 47,
                        "complexity": 10,
                        "token_count": 319,
                        "parameters": [
                            "self",
                            "indices0",
                            "values0"
                        ],
                        "start_line": 2261,
                        "end_line": 2313,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PutMask",
                        "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * mask0 , PyObject * values0)",
                        "filename": "multiarraymodule.c",
                        "nloc": 56,
                        "complexity": 10,
                        "token_count": 334,
                        "parameters": [
                            "self",
                            "mask0",
                            "values0"
                        ],
                        "start_line": 2316,
                        "end_line": 2378,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "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": 2390,
                        "end_line": 2402,
                        "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": 7,
                        "complexity": 3,
                        "token_count": 42,
                        "parameters": [
                            "object",
                            "val"
                        ],
                        "start_line": 2405,
                        "end_line": 2411,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypestrConvert",
                        "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)",
                        "filename": "multiarraymodule.c",
                        "nloc": 90,
                        "complexity": 33,
                        "token_count": 284,
                        "parameters": [
                            "itemsize",
                            "gentype"
                        ],
                        "start_line": 2415,
                        "end_line": 2524,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "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": 2539,
                        "end_line": 2564,
                        "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": 35,
                        "complexity": 10,
                        "token_count": 186,
                        "parameters": [
                            "obj",
                            "seq"
                        ],
                        "start_line": 2576,
                        "end_line": 2612,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_TypecodeConverter",
                        "long_name": "PyArray_TypecodeConverter( PyObject * obj , PyArray_Typecode * at)",
                        "filename": "multiarraymodule.c",
                        "nloc": 108,
                        "complexity": 33,
                        "token_count": 639,
                        "parameters": [
                            "obj",
                            "at"
                        ],
                        "start_line": 2621,
                        "end_line": 2759,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 139,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivalentTypes",
                        "long_name": "PyArray_EquivalentTypes( PyArray_Typecode * typ1 , PyArray_Typecode * typ2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 24,
                        "complexity": 8,
                        "token_count": 162,
                        "parameters": [
                            "typ1",
                            "typ2"
                        ],
                        "start_line": 2767,
                        "end_line": 2794,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EquivArrTypes",
                        "long_name": "PyArray_EquivArrTypes( PyArrayObject * a1 , PyArrayObject * a2)",
                        "filename": "multiarraymodule.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 80,
                        "parameters": [
                            "a1",
                            "a2"
                        ],
                        "start_line": 2797,
                        "end_line": 2808,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_fromobject",
                        "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 282,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 2830,
                        "end_line": 2881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 52,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Empty",
                        "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 15,
                        "complexity": 3,
                        "token_count": 99,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 2884,
                        "end_line": 2900,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_empty",
                        "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 21,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2906,
                        "end_line": 2930,
                        "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": 56,
                        "complexity": 11,
                        "token_count": 290,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 2935,
                        "end_line": 2999,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 65,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Zeros",
                        "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Typecode * type)",
                        "filename": "multiarraymodule.c",
                        "nloc": 20,
                        "complexity": 3,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "dims",
                            "type"
                        ],
                        "start_line": 3003,
                        "end_line": 3025,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_zeros",
                        "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 22,
                        "complexity": 3,
                        "token_count": 134,
                        "parameters": [
                            "ignored",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3031,
                        "end_line": 3055,
                        "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": 3062,
                        "end_line": 3071,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromString",
                        "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 8,
                        "token_count": 283,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3076,
                        "end_line": 3131,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 56,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_fill_in_itemsize",
                        "long_name": "_fill_in_itemsize( PyArray_Typecode * typecode)",
                        "filename": "multiarraymodule.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "typecode"
                        ],
                        "start_line": 3146,
                        "end_line": 3153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromFile",
                        "long_name": "PyArray_FromFile( FILE * fp , PyArray_Typecode * typecode , intp num , char * sep)",
                        "filename": "multiarraymodule.c",
                        "nloc": 113,
                        "complexity": 23,
                        "token_count": 682,
                        "parameters": [
                            "fp",
                            "typecode",
                            "num",
                            "sep"
                        ],
                        "start_line": 3157,
                        "end_line": 3284,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 128,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromfile",
                        "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 221,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3302,
                        "end_line": 3337,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromBuffer",
                        "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Typecode * type , intp count , int swapped)",
                        "filename": "multiarraymodule.c",
                        "nloc": 58,
                        "complexity": 11,
                        "token_count": 306,
                        "parameters": [
                            "buf",
                            "type",
                            "count",
                            "swapped"
                        ],
                        "start_line": 3340,
                        "end_line": 3403,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frombuffer",
                        "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)",
                        "filename": "multiarraymodule.c",
                        "nloc": 16,
                        "complexity": 2,
                        "token_count": 115,
                        "parameters": [
                            "ignored",
                            "args",
                            "keywds"
                        ],
                        "start_line": 3417,
                        "end_line": 3434,
                        "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": 3441,
                        "end_line": 3452,
                        "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": 3459,
                        "end_line": 3465,
                        "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": 3472,
                        "end_line": 3478,
                        "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": 3482,
                        "end_line": 3488,
                        "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": 3492,
                        "end_line": 3501,
                        "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": 29,
                        "complexity": 4,
                        "token_count": 229,
                        "parameters": [
                            "start",
                            "stop",
                            "step",
                            "type_num"
                        ],
                        "start_line": 3505,
                        "end_line": 3538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_arange",
                        "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)",
                        "filename": "multiarraymodule.c",
                        "nloc": 42,
                        "complexity": 10,
                        "token_count": 258,
                        "parameters": [
                            "ignored",
                            "args",
                            "kws"
                        ],
                        "start_line": 3544,
                        "end_line": 3592,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 11,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3612,
                        "end_line": 3623,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "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": 3,
                        "token_count": 67,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3629,
                        "end_line": 3646,
                        "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": 29,
                        "complexity": 8,
                        "token_count": 226,
                        "parameters": [
                            "condition",
                            "x",
                            "y"
                        ],
                        "start_line": 3650,
                        "end_line": 3686,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 37,
                        "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": 3694,
                        "end_line": 3702,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3708,
                        "end_line": 3719,
                        "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": 23,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "dummy",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3726,
                        "end_line": 3750,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 3810,
                        "end_line": 3919,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 110,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "set_flaginfo",
                        "long_name": "set_flaginfo( PyObject * d)",
                        "filename": "multiarraymodule.c",
                        "nloc": 23,
                        "complexity": 1,
                        "token_count": 171,
                        "parameters": [
                            "d"
                        ],
                        "start_line": 3924,
                        "end_line": 3950,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 52,
                        "complexity": 12,
                        "token_count": 361,
                        "parameters": [],
                        "start_line": 3955,
                        "end_line": 4031,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 77,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "initmultiarray",
                        "long_name": "initmultiarray()",
                        "filename": "multiarraymodule.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 341,
                        "parameters": [],
                        "start_line": 3955,
                        "end_line": 4033,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 79,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 3121,
                "complexity": 637,
                "token_count": 20350,
                "diff_parsed": {
                    "added": [
                        "",
                        "\t/* Doesn't need to be exposed to Python",
                        "\t*/"
                    ],
                    "deleted": [
                        ""
                    ]
                }
            }
        ]
    },
    {
        "hash": "b28109b23d395d89f90c0ef248501368c801f539",
        "msg": "Fixed __array_data__ interface.",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-14T08:34:08+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T08:34:08+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "0282cf783893d0bf8908120a1995af51eabb361b"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 9,
        "insertions": 34,
        "lines": 43,
        "files": 2,
        "dmm_unit_size": 0.2222222222222222,
        "dmm_unit_complexity": 0.2222222222222222,
        "dmm_unit_interfacing": 0.2222222222222222,
        "modified_files": [
            {
                "old_path": "scipy/base/src/arrayobject.c",
                "new_path": "scipy/base/src/arrayobject.c",
                "filename": "arrayobject.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -3738,6 +3738,12 @@ array_priority_get(PyArrayObject *self)\n }\n \n \n+static PyObject *\n+array_dataptr_get(PyArrayObject *self)\n+{\n+\treturn PyString_FromFormat(\"%p\", self->data);\n+}\n+\n static PyObject *\n array_data_get(PyArrayObject *self)\n {\n@@ -4244,7 +4250,7 @@ static PyGetSetDef array_getsetlist[] = {\n \t (setter)array_flat_set, \n \t \"a 1-d view of a contiguous array\"}, \n \t{\"__array_data__\", \n-\t (getter)array_data_get,\n+\t (getter)array_dataptr_get,\n \t NULL,\n \t \"Array protocol: data\"},\n \t{\"__array_typestr__\",\n@@ -5201,14 +5207,27 @@ array_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n \t/* Get the strides */\n \t\n \tattr = PyObject_GetAttrString(input, \"__array_data__\");\n-\tif (attr == NULL) {\n-\t\tPy_INCREF(input);\n-\t\tattr = input;\n+\tif (attr && !PyString_Check(attr)) {\n+\t\tPyErr_SetString(PyExc_TypeError, \"__array_data__ must return\"\\\n+\t\t\t\t\" a string providing the pointer to data.\");\n+\t\tPy_DECREF(attr);\n+\t\treturn NULL;\n+\t}\n+\tif ((attr == NULL) || (PyString_GET_SIZE(attr) < 1)) {\n+\t\tres = PyObject_AsWriteBuffer(input, (void **)&data, \n+\t\t\t\t\t     &buffer_len);\n+\t\tPy_XDECREF(attr);\n+\t\tif (res < 0) return NULL;\n+\t}\n+\telse {\n+\t\tres = sscanf(PyString_AsString(attr), \"%p\", (void **)&data);\n+\t\tPy_DECREF(attr);\n+\t\tif (res < 1) {\n+\t\t\tPyErr_SetString(PyExc_TypeError, \n+\t\t\t\t\t\"__array_data__ cannot be converted.\");\n+\t\t\treturn NULL;\n+\t\t}\n \t}\n-\t\n-\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n-\tPy_DECREF(attr);\n-\tif (res < 0) return NULL;\n \n \tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n \tif (!PyString_Check(attr)) {\n",
                "added_lines": 27,
                "deleted_lines": 8,
                "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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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 PyString_FromFormat(\"%p\", self->data);\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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr && !PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_data__ must return\"\\\n\t\t\t\t\" a string providing the pointer to data.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tif ((attr == NULL) || (PyString_GET_SIZE(attr) < 1)) {\n\t\tres = PyObject_AsWriteBuffer(input, (void **)&data, \n\t\t\t\t\t     &buffer_len);\n\t\tPy_XDECREF(attr);\n\t\tif (res < 0) return NULL;\n\t}\n\telse {\n\t\tres = sscanf(PyString_AsString(attr), \"%p\", (void **)&data);\n\t\tPy_DECREF(attr);\n\t\tif (res < 1) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_data__ cannot be converted.\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\nstatic PyObject *\nPyArray_ContiguousFromAny(PyObject *op, int type, int min_depth, \n\t\t\t  int max_depth)\n{\n\tPyArray_Typecode typecode = {0,0,0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS);\n}\t\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n/*\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n*/\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\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 MapIterNew must be \n   that does not work.  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 char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n \tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\t\n \tPyArray_MapIterReset(mit);\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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, /*arraymapiter_next,*/\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\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/* $Id: arrayobject.c,v 1.59 2005/09/14 00:14:00 teoliphant Exp $ */\n\n/*\n#include \"Python.h\"\n#include \"structmember.h\"\n\n#define _MULTIARRAYMODULE\n#include \"Numeric3/arrayobject.h\"\n*/\n\n/* Helper functions */\n\n#define error_converting(x)  (((x) == -1) && PyErr_Occurred())\n\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_Typecode typecode = {PyArray_INTP, 0, 0};\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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_Typecode typecode = {PyArray_INT, 0, 0};\n\tint ret;\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\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\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, &typecode);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, &typecode);\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\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\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n        char *zeroval;\n        char *buf;\n        int buf_len;\n        PyObject *obj, *ret;\n\n        zeroval = PyDataMem_NEW(arr->itemsize);\n        if (zeroval == NULL) {\n                PyErr_SetNone(PyExc_MemoryError);\n                return NULL;\n        }\n\n        if (PyArray_ISOBJECT(arr)) {\n                obj=PyInt_FromLong((long) 0);\n                memcpy(zeroval, &obj, sizeof(PyObject *));\n                Py_DECREF(obj);\n                return zeroval;\n        }\n        ret = PyObject_GetAttrString((PyObject *)arr, \"_zero\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_zero not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        return NULL;\n                }\n                memcpy(zeroval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n        memset(zeroval, 0, arr->itemsize);\n        return zeroval;\n}\n\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n        char *oneval;\n        char *buf;\n        int buf_len, ret2;\n        PyObject *obj, *ret;\n\n        oneval = PyDataMem_NEW(arr->itemsize);\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        ret = PyObject_GetAttrString((PyObject *)arr, \"_one\");\n        if (ret != NULL) {\n                if (PyObject_AsReadBuffer(ret, (const void **)&buf, \n                                          &buf_len) < 0) {\n                        PyErr_SetString(PyExc_ValueError, \n                                        \"_one not returning \"          \\\n                                        \"writeable buffer.\");\n                        Py_DECREF(ret);\n                        PyDataMem_FREE(oneval);\n                        return NULL;\n                }\n                memcpy(oneval, buf, buf_len);\n                Py_DECREF(ret);\n        }\n        if (PyErr_Occurred()) PyErr_Clear();\n\n        ret2 = arr->descr->setitem(obj, oneval, arr);\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<copies; j++) {\n                        memmove(dest, src, elsize);\n                        dest += elsize;\n                }\n                return 0;\n        }\n\t\n        if (dest_nd > 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<copies; j++) {\n                                memmove(dest, src, elsize);\n                                dest += *dest_strides;\n                        }\n                }\n        } else {\n                for(i=0; i<*dest_dimensions; i++, dest += *dest_strides, \n                            src += *src_strides) {\n                        if (do_sliced_copy(dest, dest_strides+1, \n                                           dest_dimensions+1, dest_nd-1, \n                                           src, src_strides+1, \n                                           src_dimensions+1, src_nd-1, \n                                           elsize, copies) == -1) \n                                return -1;\n                }\n        }\n        return 0;\n}\n\n/* This function reduces a source and destination array until a\n   discontiguous segment is found in either the source or\n   destination. Thus, an N dimensional array where the last dimension\n   is contiguous and has size n while the items are of size elsize,\n   will be reduced to an N-1 dimensional array with items of size n *\n   elsize.\n\n   This process is repeated until a discontiguous section is found.\n   Thus, a contiguous array will be reduced to a 0-dimensional array\n   with items of size elsize * sizeof(N-dimensional array).\n\n   Finally, if a source array has been reduced to a 0-dimensional\n   array with large element sizes, the contiguous destination array is\n   reduced as well.\n\n   The only thing this function changes is the element size, the\n   number of copies, and the source and destination number of\n   dimensions.  The strides and dimensions are not changed. \n*/\n\nstatic int \noptimize_slices(intp **dest_strides, intp **dest_dimensions, \n\t\t    int *dest_nd, intp **src_strides, \n\t\t    intp **src_dimensions, int *src_nd,\n\t\t    int *elsize, int *copies) \n{\n        while (*src_nd > 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->itemsize;\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 *)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 { free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n                             int, intp *, char *, 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. */\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; i<n; i++, data++) Py_XINCREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\nstatic int \nPyArray_XDECREF(PyArrayObject *mp) \n{\n        intp i, 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; i<n; i++, data++) Py_XDECREF(*data);\n\t\n        if (!PyArray_ISONESEGMENT(mp)) free(data2);\n\t\n        return 0;\n}\n\n/* byte-swap inplace (unrolled loops for special cases) */\nstatic void \nbyte_swap_vector(void *p, int n, int size) {\n        char *a, *b, c=0;\n        int j,m;\n\n        switch(size) {\n        case 1: /* no byteswap necessary */\n                break;\n        case 2:\n                for (a = (char*)p ; n > 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<m; j++)\n                                c=*a; *a++ = *b; *b-- = c;\n                }\n                break;\n        }\n}\n\n\n/* If numitems > 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\n\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, int i) \n{\n\tif (i==0 && (mp->nd == 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\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\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                                \"Destination number of elements must be\"\\\n                                \"an integer multiple of the source number of\"\\\n                                \"elements.\");\n                return -1;\n        }\n        ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->copyswap;\n\tcopyswapn = dest->descr->copyswapn;\n\n        elsize = dest->itemsize;\n\n        if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src)) \\\n\t    || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n               \n                PyArray_XDECREF(dest);\n                dptr = dest->data;\n                sbytes = ssize * src->itemsize;\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\tPyArray_Typecode typecode;\n\n\n\ttypecode.type_num = dest->descr->type_num;\n\ttypecode.itemsize = dest->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(dest);\n\t\t\t\n        src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t       &typecode, 0,\n\t\t\t\t\t       dest->nd, 0);\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\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n                                PyArray_Descr *descr,\n                                char *data) {\n\tPyObject *ret;\n\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n\t\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n        ret = PyArray_New(&PyArray_Type, nd, newd, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n                           descr->type_num, NULL, data, descr->elsize, \n\t\t\t   0, NULL);\n#endif\n\tif (descr->type_num != PyArray_OBJECT)\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDimsAndData(int nd, int *d, int type, char *data) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\t\n\tintp newd[MAX_DIMS];\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i]; \n\tret = PyArray_New(&PyArray_Type, nd, newd, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, \n\t\t\t   type, NULL, data, 0, \n\t\t\t   0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n                /* already done*/\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n\nstatic PyObject *\nPyArray_FromDims(int nd, int *d, int type) \n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tintp newd[MAX_DIMS];\n\tint i;\t\n\n\tfor (i=0; i<nd; i++) newd[i] = (intp) d[i];\n\tret = PyArray_New(&PyArray_Type, nd, newd, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#else\n\tret = PyArray_New(&PyArray_Type, nd, (intp *)d, type,\n\t\t\t   NULL, NULL, 0, 0, NULL);\n#endif\n\tif (type != PyArray_OBJECT && type != PyArray_OBJECTLTR) \n\t\tmemset(PyArray_DATA(ret), 0, PyArray_SIZE(ret));\n\treturn ret;\n}\n\n/* end old calls */\n\n/* Copy should always return contiguous array */\nstatic PyObject *\nPyArray_Copy(PyArrayObject *m1) \n{\n\tPyArrayObject *ret;\n\tret = (PyArrayObject *)PyArray_New(m1->ob_type, m1->nd, \n\t\t\t\t\t   m1->dimensions,\n\t\t\t\t\t   m1->descr->type_num,\n\t\t\t\t\t   NULL, NULL, m1->itemsize,\n\t\t\t\t\t   0, (PyObject *)m1);\n\t\n        if (PyArray_CopyInto(ret, m1) == -1) return NULL;\n\t\n        return (PyObject *)ret;\n}\n\n\nstatic PyObject *array_item(PyArrayObject *, int);\n\nstatic PyObject *\nPyArray_Scalar(char *data, int type_num, int itemsize, int swap)\n{\n        PyArray_Descr *descr;\n\tPyTypeObject *type;\n\tPyObject *obj;\t\n\tchar *destptr;\n        PyArray_CopySwapFunc *copyswap;\n\n        descr = PyArray_DescrFromType(type_num);\n        if (descr == NULL) return NULL;\n        type = descr->typeobj;\n        copyswap = descr->copyswap;\n\tif (type_num == PyArray_STRING) \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_ISFLEXIBLE(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 {\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n\t\t\t\tPyObject_Del(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tif (type_num == PyArray_UNICODE) {\n\t\t\t\tPyUnicode_AS_UNICODE(obj) = \\\n\t\t\t\t\t(Py_UNICODE *)destptr;\n\t\t\t\t((PyUnicodeObject*)obj)->length = itemsize / \\\n\t\t\t\t\tsizeof(Py_UNICODE);\n\t\t\t\t((PyUnicodeObject*)obj)->hash = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t((PyVoidScalarObject *)obj)->obval = destptr;\n\t\t\t\t((PyVoidScalarObject *)obj)->ob_size = itemsize;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tdestptr = &(((PyScalarObject*)obj)->obval);\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*/\nstatic PyObject *\nPyArray_ToScalar(char *data, PyArrayObject *arr)\n{\n\tint type_num = arr->descr->type_num;\n\tint itemsize = arr->itemsize;\n        int swap = !(PyArray_ISNOTSWAPPED(arr));\n\n\treturn PyArray_Scalar(data, type_num, itemsize, swap);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n        \n\tif (mp == NULL) return NULL;\n\n        if (PyErr_Occurred()) {\n                Py_XDECREF(mp);\n                return NULL;\n        }\n\n\tif (PyArray_Check((PyObject *)mp) && 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*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\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; i<PyArray_NUMUSERTYPES; i++) {\n\t\tdescr = userdescrs[i];\n\t\tif (descr->typeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = malloc(sizeof(PyArray_Descr));\n\tmemcpy(descr, PyArray_DescrFromType(PyArray_VOID), \n\t       sizeof(PyArray_Descr));\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n\tdescr->typeobj = 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                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   frees the copy of the Descr_table already there.\n   places a pointer to the new one into the slot.\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\tint i;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Data type not registered.\");\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n#define _NULL_CHECK(member) \\\n\tif (descr->member == NULL) descr->member = old->member\n\n\tfor (i=0; i<PyArray_NTYPES; i++) {\n\t\t_NULL_CHECK(cast[i]);\n\t}\n\t_NULL_CHECK(getitem);\n\t_NULL_CHECK(setitem);\n\t_NULL_CHECK(compare);\t\n\t_NULL_CHECK(argmax);\n\t_NULL_CHECK(dotfunc);\n\t_NULL_CHECK(scanfunc);\n\t_NULL_CHECK(copyswapn);\n\t_NULL_CHECK(copyswap);\n\t_NULL_CHECK(nonzero);\n#undef _NULL_CHECK\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\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tfree(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\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        n3 = strlen((const char *)sep);\n        if (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 \"\\\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->itemsize,\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->itemsize,\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 = strlen((const char *)format);\n                while(it->index < it->size) {\n                        obj = self->descr->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\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->getitem(self->data,self);\n\t\n        sz = self->dimensions[0];\n        lp = PyList_New(sz);\n\t\n        for (i=0; i<sz; i++) {\n                v=(PyArrayObject *)array_item(self, i);\n\t\tif (v->nd >= 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\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        if (PyArray_TYPE(self) == PyArray_OBJECT) {\n                PyErr_SetString(PyExc_ValueError, \"a string for the data\"\\\n\t\t\t\t\"in an object array is not appropriate.\");\n                return NULL;\n        }\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->itemsize;\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 != NULL)) {\n\t\t/* Free internal references if an Object array */\n\t\tPyArray_XDECREF(self);\n\n                PyDataMem_FREE(self->data);\n        }\n\t\n        if (self->dimensions != NULL) {\n                PyDimMem_FREE(self->dimensions); \n\t}\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\n\nstatic PyObject *\narray_item(PyArrayObject *self, int i) \n{\n    char *item;\n    PyArrayObject *r;\n\n\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\n\tr = (PyArrayObject *)PyArray_New(self->ob_type, \n\t\t\t\t\t self->nd-1, self->dimensions+1, \n\t\t\t\t\t self->descr->type_num, \n\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t self->itemsize, self->flags,\n\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_item(self, i));\n}\n\n\nstatic int \narray_ass_item(PyArrayObject *self, int 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\n        if (i < 0) i = i+self->dimensions[0];\n\n        if (self->nd > 1) {\n                if((tmp = (PyArrayObject *)array_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->setitem(v, item, self) == -1) return -1;\n        return 0;\n}\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, int *v)\n{\n\t*v = PyArray_PyIntAsInt(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, int length,\n                 int *start, int *stop, int *step,\n                 intp *slicelength)\n{\n\tint 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 can not 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 int\nparse_subindex(PyObject *op, int *step_size, intp *n_steps, int max)\n{\n\tint 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\tint 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_PyIntAsInt(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, start, offset, n_add, n_pseudo;\n        int step_size;\n\tintp n_steps;\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; i<n; i++) {\n                if (!is_slice) {\n                        if (!(op1=PySequence_GetItem(op, i))) {\n                                PyErr_SetString(PyExc_IndexError, \n                                                \"invalid index\");\n                                return -1;\n                        }\n                }\n\t\n                start = parse_subindex(op1, &step_size, &n_steps, \n                                       nd_old < self->nd ? \\\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; j<n; j++) {\n                                        op1 = PySequence_GetItem(op, j);\n                                        if (op1 == Py_None) n_pseudo++;\n                                        Py_DECREF(op1);\n                                }\n                                n_add = self->nd-(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; j<n_add; j++) {\n                                        dimensions[nd_new] = \\\n                                                self->dimensions[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; j<n_add; j++) {\n                dimensions[nd_new] = self->dimensions[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, *tup;\n\tint n1, n2, n3, val;\n\tint i;\n\n\ttup = PyTuple_New(mit->nd);\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\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = 0;\n\twhile(val < n1)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tPyTuple_SET_ITEM(tup, i++, PyInt_FromLong((long)val++));\n\n\tnew = PyArray_Transpose(*ret, tup);\n\tPy_DECREF(tup);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n\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\tret = (PyArrayObject *)\\\n\t\tPyArray_New(temp->ob_type, mit->nd, mit->dimensions, \n\t\t\t    temp->descr->type_num, NULL, NULL, \n\t\t\t    temp->itemsize, \n\t\t\t    PyArray_ISFORTRAN(temp),\n\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\treturn NULL;\n\tindex = it->size;\n\tswap = ((temp->flags & NOTSWAPPED) != (ret->flags & NOTSWAPPED));\n        copyswap = ret->descr->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n                copyswap(it->dataptr, mit->dataptr, swap, ret->itemsize);\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\tPyArray_Typecode typecode = {0, 0, 0};\n        PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\ttypecode.type_num = mit->ait->ao->descr->type_num;\n\ttypecode.itemsize = mit->ait->ao->itemsize;\n\n\tarr = PyArray_FromAny(op, &typecode, \n\t\t\t      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\treturn -1;\n\n\tindex = mit->size;\n\tswap = ((mit->ait->ao->flags & NOTSWAPPED) != \\\n\t\t(PyArray_FLAGS(arr) & NOTSWAPPED));\n\n        copyswap = PyArray_DESCR(arr)->copyswap;\n\tPyArray_MapIterReset(mit);\n        /* Need to decref OBJECT arrays */\n        if (PyTypeNum_ISOBJECT(typecode.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                        copyswap(mit->dataptr, NULL, swap, \n                                  sizeof(PyObject *));\n                        PyArray_MapIterNext(mit);\n                        PyArray_ITER_NEXT(it);\n                        if (it->index == it->size)\n                                PyArray_ITER_RESET(it);\n                }\n                return 0;\n        }\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\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 0-dimensional arrays */\n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n        intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n        int nd, i;\n        PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n        if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n            PyLong_Check(op)) {\n                intp value;\n                value = PyArray_PyIntAsIntp(op);\n                if (PyErr_Occurred())\n                        PyErr_Clear();\n                else if (value >= 0) {\n                        if (value <= MAX_INT)\n                                return array_item(self, (int) value);\n                }\n                else if (value < 0) {\n                        if (value >= -MAX_INT) {\n                                if (self->nd > 0) value += self->dimensions[0];\n                                return array_item(self, (int) value);\n                        }\n                }\n        }\n\n\tif (PyArrayMapIter_Check(op)) {\n\t\tmit = (PyArrayMapIterObject *)op;\n\t\t/* bind to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\n\t\t/* If the mapiterator was created with standard indexing\n\t\t   behavior, fall through to view-based code */\n\t\tif (!mit->view) return PyArray_GetMap(mit);\n\t\top = mit->indexobj;\n\t}\n\telse { /* wrap arguments into a mapiter object */\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(op);\n\t\tif (mit == NULL) return NULL;\n\t\tif (!mit->view) {  /* fancy indexing */\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tother = (PyArrayObject *)PyArray_GetMap(mit);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn (PyObject *)other;\n\t\t}\n\t\tPy_DECREF(mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_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\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t     PyArray_New(self->ob_type, nd, dimensions, self->descr->type_num,\n\t\t\t strides, self->data+offset, \n\t\t\t self->itemsize, self->flags,\n\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 \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n        int ret, i;\n        PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n        if (op == 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\n\tif (PyArrayMapIter_Check(index)) {\n\t\tmit = (PyArrayMapIterObject *)index;\n\t\t/* bind behavior to current array */\n\t\tPyArray_MapIterBind(mit, self);\n\t\t\t\n\t\t/* fall through if standard view-based map iterator */\n\t\tif (!mit->view) return PyArray_SetMap(mit, op);\n\t\tindex = mit->indexobj;\n\t}\n\telse {\n\t\tmit = (PyArrayMapIterObject *)PyArray_MapIterNew(index);\n\t\tif (mit == NULL) return -1;\n\t\tif (!mit->view) {\n\t\t\tPyArray_MapIterBind(mit, self);\n\t\t\tret = PyArray_SetMap(mit, op);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn ret;\n\t\t}\n\t\tPy_DECREF((PyObject*)mit);\n\t}\n\n\ti = PyArray_PyIntAsInt(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_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        ret = PyArray_CopyObject(tmp, op);\n        Py_DECREF(tmp);\n\t\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        \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\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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\targs = Py_BuildValue(\"(Oii)\", m1, axis, rtype);\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        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OO)\", m1, m2);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(O)\", m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t     PyObject *m2, PyObject *op) \n{\n        PyObject *args, *ret;\n        if (op == NULL) {\n                Py_INCREF(Py_NotImplemented);\n                return Py_NotImplemented; \n        }\n        args = Py_BuildValue(\"(OOO)\", m1, m2, m1);\n        ret = PyObject_Call(op, args, NULL);\n        Py_DECREF(args);\n        return ret;\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_all_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = 0;\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->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = 1;\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 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->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->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->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->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->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_all_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, \"can't 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        r = (PyArrayObject *)\\\n\t\tPyArray_New(self->ob_type, self->nd, self->dimensions, \n\t\t\t    self->descr->type_num, self->strides, data,\n\t\t\t    self->itemsize, 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                                \"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 ((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 any(self == el) */\n\n        return PyObject_RichCompareBool((PyObject *)self, el, Py_EQ);\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 *)realloc(*string, *max_n); }\n\t\n        if (nd == 0) {\n\t\t\n                if ((op = descr->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; i<dimensions[0]; i++) {\n                        if (dump_data(string, n, max_n, \n                                      data+(*strides)*i, \n                                      nd-1, dimensions+1, \n                                      strides+1, self) < 0) \n                                return -1;\n                                CHECK_MEMORY\n                                        if (i<dimensions[0]-1) {\n                                                (*string)[*n] = ','; \n                                                (*string)[*n+1] = ' ';\n                                                *n += 2;\n                                        }\n                }\n                CHECK_MEMORY\n                        (*string)[*n] = ']'; *n += 1;\n                return 0;\n        }\n\n#undef CHECK_MEMORY\n}\n\nstatic PyObject * \narray_repr_builtin(PyArrayObject *self) \n{\n        PyObject *ret;\n        char *string;\n        int n, max_n;\n\t\n        max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;\n\t\n        if ((string = (char *)malloc(max_n)) == NULL) {\n                PyErr_SetString(PyExc_MemoryError, \"out of memory\");\n                return NULL;\n        }\n\t\n        n = 6;\n        sprintf(string, \"array(\");\n\t\n        if (dump_data(&string, &n, &max_n, self->data, \n\t\t      self->nd, self->dimensions, \n                      self->strides, self) < 0) { \n\t\tfree(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISFLEXIBLE(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->itemsize);\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        free(string);\n        return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\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\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; i<len; i++) {\n                PyObject *o = PyInt_FromLong(vals[i]);\n                if (!o) {\n                        Py_DECREF(intTuple);\n                        intTuple = NULL;\n                        goto fail;\n                }\n                PyTuple_SET_ITEM(intTuple, i, o);\n        }\n  fail:\n        return intTuple;\t\n}\n\n/* Returns the number of dimensions or -1 if an error occurred */\n/*  vals must be large enough to hold maxvals */\nstatic int\nPyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals) \n{\n        int nd, i;\n\tPyObject *op;\n        \n        /* Check to see if sequence is a single integer first. \n             or, can be made into one */\n\tif ((nd=PySequence_Length(seq)) == -1) {\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n\t\tif (!(op = PyNumber_Int(seq))) return -1;\n\t\tnd = 1;\n\t\tvals[0] = (intp ) PyInt_AsLong(op);\n\t\tPy_DECREF(op);\n\t} else {\n\t\tfor(i=0; i < MIN(nd,maxvals); i++) {\n\t\t\top = PySequence_GetItem(seq, i);\n\t\t\tif (op == NULL) return -1;\n\t\t\tvals[i]=(intp )PyInt_AsLong(op);\n\t\t\tPy_DECREF(op);\n\t\t\tif(PyErr_Occurred()) return -1;\n\t\t}\n\t}\n\treturn nd;\n}\n\n\n/* Check whether the given array is stored contiguously (row-wise) in\n   memory. */\nstatic int\n_IsContiguous(PyArrayObject *ap) \n{\n\tint sd;\n\tint i;\n\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\tint sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->itemsize;\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\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\n\tptr = (intp) ap->data;\n        aligned = (ptr % alignment) == 0;\n        for (i=0; i <ap->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\tPyBufferProcs *pb;\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\tpb = base->ob_type->tp_as_buffer;\n\tif (pb == NULL || pb->bf_getwritebuffer == NULL)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\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\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by either numbytes or\n a single segment array of the provided dimensions and element size if\n numbytes is 0 */\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<nd; i++) {\n\t\tif (newstrides[i]*(dims[i]-1)+elsize > 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<nd; i++) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= FORTRAN;\n\t\tif (nd > 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\t\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n            intp *strides, char *data, int itemsize, int flags,\n\t    PyObject *obj)\n{\n\tPyArrayObject *self;\n\tPyArray_Descr *descr;\n\tregister int i;\n\tintp sd, temp;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\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                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\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) return NULL;\t\n\tself->descr = descr;\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\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"Type must provide an itemsize.\");\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn NULL;\n\t\t}\n\t\tself->itemsize = itemsize;\n\t\t/* Guarantee that these kind of arrays are never byteswapped\n\t\t   unknowingly.  \n\t\t*/\n\t\tif (type_num != PyArray_UNICODE)\n\t\t\tself->flags |= NOTSWAPPED;\n\t}\n\telse self->itemsize = descr->elsize; \n\t\t\n\tsd = self->itemsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\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\t\t\n\tif (data == NULL) {\n\n\t\t/* Make sure we are aligned on void ptrs (without wasting\n\t\t space if we already are).  But, also, allocate something \n\t\t even for zero-space arrays e.g. shape=(0,) -- otherwise\n                 buffer exposure (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\t\telse if ((temp=sd%sizeof(intp))) sd += sizeof(intp) - temp;\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\t/* We shouldn't need to check for the OBJECT Letter\n\t\t   but perhaps it's best. */\n\t\tif (type_num == PyArray_OBJECT || \\\n\t\t    type_num == PyArray_OBJECTLTR) {\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\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) PyErr_Clear();\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n}\n\n\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 = (((PyObject *)self)->ob_refcnt);\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->itemsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"can't 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->itemsize;\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; k<n; k++) {\n                                Py_INCREF(zero);\n                                *optr++ = zero;\n\t\t\t}\n\t\t\tPy_DECREF(zero);\n\t\t}\n\t\telse{\t\t\n\t\t\tmemset(self->data+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                                        \"can't 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->itemsize;\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\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; i<n; i++) {\n                        *optr++ = NULL;\n                }\n        }\n        else {\n                for (i=0; i<n; i++) {\n                        Py_INCREF(obj);\n                        *optr++ = obj;\n                }\n        }\n}        \n\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \"strides\", \n                                 \"swap\", \"fortran\", NULL};\n\tint itemsize = 0;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\tint type_num = PyArray_NOTYPE;\n        PyArray_Dims dims = {NULL, 0};\n        PyArray_Dims strides = {NULL, 0};\n        PyArray_Chunk buffer;\n\tint fortran = 0;\n        int swapped = 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&O&ii\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n                                         &dims, \n                                         PyArray_TypecodeConverter,\n\t\t\t\t\t &typecode, \n                                         PyArray_BufferConverter,\n                                         &buffer,\n                                         &PyArray_IntpConverter, \n                                         &strides,\n                                         &swapped, &fortran)) \n\t\treturn NULL;\n\t\n        if (typecode.type_num ==PyArray_NOTYPE) {\n\t\ttypecode.type_num = PyArray_DOUBLE;\n\t\ttypecode.itemsize = sizeof(double);\n\t}\n\ttype_num = typecode.type_num;\n\titemsize = typecode.itemsize;\n\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 *)PyArray_New(subtype, (int)dims.len, \n                                                   dims.ptr, type_num,\n                                                   NULL, NULL, itemsize, \n                                                   fortran, NULL);\n                \n                if (ret == 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                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                if (!(swapped)) buffer.flags |= NOTSWAPPED;\n                ret = (PyArrayObject *)PyArray_New(subtype, dims.len, \n                                                   dims.ptr, type_num,\n                                                   strides.ptr,\n                                                   (char *)buffer.ptr, \n                                                   itemsize, \n                                                   buffer.flags, NULL); \n                if (ret == 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 PyArray_Return(ret);\n        \n fail:\n        if (dims.ptr) PyDimMem_FREE(dims.ptr);\n        if (strides.ptr) PyDimMem_FREE(strides.ptr);\n        return NULL;\n}\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        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, self->flags, 0);\n}\n\n/*\nstatic int\narray_flags_set(PyArrayObject *self, PyObject *obj) \n{\n\tint flagback = self->flags;\n\n        if (PyDict_Check(obj)) {\n                PyObject *new;\n\t\tnew = PyDict_GetItemString(obj, \"ALIGNED\");\n\t\tif (new) {\n\t\t\tif (PyObject_Not(new)) self->flags &= ~ALIGNED;\n\t\t\telse if (_IsAligned(self)) self->flags |= ALIGNED;\n\t\t\telse {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"cannot set aligned flag of \" \\\n\t\t\t\t\t\t\"mis-aligned array to True\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n                new = PyDict_GetItemString(obj, \"UPDATEIFCOPY\");\n                if (new) {\n                        if (PyObject_Not(new)) {\n                                self->flags &= ~UPDATEIFCOPY;\n                                Py_DECREF(self->base);\n                                self->base = NULL;\n                        }\n                        else {\n\t\t\t\tself->flags = flagback;\n                                PyErr_SetString(PyExc_ValueError, \n                                                \"cannot set UPDATEIFCOPY\" \\\n                                                \"flag to True\");\n                                return -1;\n                        }\n                }\n                new = PyDict_GetItemString(obj, \"WRITEABLE\");\n                if (new) {\n\t\t\tif (PyObject_IsTrue(new)) {\n\t\t\t\tif (_IsWriteable(self)) {\n\t\t\t\t\tself->flags |= WRITEABLE;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself->flags = flagback;\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\t\"cannot set \"\t\\\n\t\t\t\t\t\t\t\"WRITEABLE \"\t\\\n\t\t\t\t\t\t\t\"flag to True of \"\\\n\t\t\t\t\t\t\t\"this array \");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n                        else\n                                self->flags &= ~WRITEABLE;\n                }\n                new = PyDict_GetItemString(obj, \"NOTSWAPPED\");\n                if (new) {\n                        if (PyObject_IsTrue(new))\n                                self->flags |= NOTSWAPPED;\n                        else {\n                                self->flags &= ~NOTSWAPPED;\n\t\t\t}\n\t\t}\n                return 0;\n        }\n        PyErr_SetString(PyExc_ValueError, \n                        \"Object must be a dictionary\");\n        return -1;\n}\n*/\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\tif (!PyTuple_Check(val)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"shape must be a tuple\");\n\t\treturn -1;\n\t}\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\t\n\tif (self->nd > 0) { /* Free old dimensions and strides */\n\t\tPyDimMem_FREE(self->dimensions);\n\t}\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;\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\treturn -1;\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->itemsize;\n\t\n\tif (!PyArray_CheckStrides(self->itemsize, 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\treturn -1;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\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_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->itemsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tlonglong size=PyArray_SIZE(self);\n\tif (size > MAX_INT || size < MIN_INT)\n\t\treturn PyLong_FromLongLong((longlong) size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISFLEXIBLE(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t   self->itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\tstatic char endians[] = \"<>\";\n\tchar endian;\n\tint which;\n\tunsigned long val = 1;\n\tchar *s;\n\tchar basic_=self->descr->kind;\n\n\ts = (char *)&val; /* s[0] == 0 implies big-endian */\n\twhich = (PyArray_ISNOTSWAPPED(self) ? 0 : 1);\n\tif (s[0] == 0) which = 1 - which;\n\tendian = endians[which];       \n\t\n\tif ((basic_==PyArray_VOIDLTR) || (basic_==PyArray_STRINGLTR) || \\\n\t    (basic_==PyArray_OBJECTLTR) || (self->itemsize == 1))\n\t\treturn PyString_FromFormat(\"|%c%d\", basic_, self->itemsize);\n\telse\n\t\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t\t   self->itemsize);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\n\t/* hand this off to the typeobject */\n\t/* or give default */\n\tif (PyArray_ISUSERDEF(self)) {\n\t\tres = PyObject_GetAttrString((PyObject *)self->descr->typeobj, \n\t\t\t\t\t     \"__array_descr__\");\n\t\tif (res) return res;\n\t\tPyErr_Clear();\n\t}\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_typenum_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->type_num);\n}\n\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n\treturn PyArray_TypeObjectFromType(self->descr->type_num);\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*/\n\nstatic int\narray_type_set(PyArrayObject *self, PyObject *arg)\n{\n        PyArray_Typecode newtype = {PyArray_NOTYPE, 0, 0};\n        intp newdim;\n        int index;\n        char *msg = \"new type not compatible with array.\";\n\n        if ((PyArray_TypecodeConverter(arg, &newtype) < 0) ||\n            newtype.type_num == PyArray_NOTYPE) {\n                PyErr_SetString(PyExc_TypeError, \"Invalid type for array\");\n                return -1;\n        }\n        if (!(PyArray_ISONESEGMENT(self) ||\t\t\\\n\t      (newtype.itemsize != self->itemsize))) {\n                PyErr_SetString(PyExc_ValueError, msg);\n                return -1;                 \n        }\n\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\n        if (newtype.itemsize < self->itemsize) {\n                /* if it is compatible increase the size of the dimension\n                   at end (or at the front for FORTRAN)\n                */\n                if (self->itemsize % newtype.itemsize != 0) {\n                        PyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n                newdim = self->itemsize / newtype.itemsize;\n\t\tself->dimensions[index] *= newdim;\n                self->strides[index] = newtype.itemsize;\n\t}\n        \n        else if (newtype.itemsize > self->itemsize) {\n        \n                /* Determine if last (or first if FORTRAN) dimension\n                   is compatible */\n\n\t\tnewdim = self->dimensions[index] * self->itemsize;\n                if ((newdim % newtype.itemsize) != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n                        return -1;\n                }\n\t\t\n                self->dimensions[index] = newdim / newtype.itemsize;\n                self->strides[index] = newtype.itemsize;\n\t\t\n        }\n\t\n        \n        /* fall through -- adjust type*/\n\n        self->descr = PyArray_DescrFromType(newtype.type_num);\n        self->itemsize = newtype.itemsize;\n        PyArray_UpdateFlags(self, ALIGNED);\n        return 0;\n\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) 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\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n\tint itemsize;\n\tint typenum;\n        PyArray_Typecode type;\n\t\n\ttype.type_num = self->descr->type_num;\n\ttype.itemsize = self->itemsize;\n\ttype.fortran = PyArray_ISFORTRAN(self);\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\titemsize = self->itemsize >> 1;\n\t\ttypenum = self->descr->type_num - PyArray_NUM_FLOATTYPE;\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   typenum,\n\t\t\t\t\t\t   self->strides,\n\t\t\t\t\t\t   self->data + itemsize,\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\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t     self->dimensions, &type);\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->itemsize >> 1) ,\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) {\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_Typecode typecode;\n        int swap;\n        PyArray_CopySwapFunc *copyswap;\n\n\ttypecode.type_num = self->descr->type_num;\n\ttypecode.itemsize = self->itemsize;\n\ttypecode.fortran = PyArray_ISFORTRAN(self);\n\t\n\tarr = PyArray_FromAny(val, &typecode, \n\t\t\t      0, 0, FORCECAST);\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->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                        copyswap(selfit->dataptr, NULL, swap, \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->itemsize);\n                copyswap(selfit->dataptr, NULL, swap, self->itemsize);\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\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 (setter)array_type_set,\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{\"dtypenum\",\n\t (getter)array_typenum_get,\n\t NULL,\n\t \"get array type number code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\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_data_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_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\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\n\nstatic char Arraytype__doc__[] = \n        \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\"  of basic values.  Arrays are sequence, mapping and numeric\\n\"\n\t\"  objects.  More information is available in the scipy module and\\n\"\n\t\"  by looking at the methods and attributes of an array.\";\n\nstatic PyTypeObject PyBigArray_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"scipy.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)0,      \t\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        0,\t                                  /* tp_alloc */ \n        (newfunc)array_new,\t\t          /* tp_new */\n        0,\t               \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        \"scipy.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) \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        if (PySequence_Length(s) == 0) \n\t\treturn 1;\n\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);\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; i++) {\n\t\tif ((e=PySequence_GetItem(s,i))==NULL) return -1;\n                r=discover_itemsize(e,nd-1,itemsize);\n                Py_DECREF(e);\n                if (r == -1) return -1; \n        }\n        return 0;\n}\n\n/* Take an arbitrary object known to represent\n   an array of ndim nd, and determine the size in each dimension\n*/\n\nstatic int \ndiscover_dimensions(PyObject *s, int nd, intp *d, int check_it) \n{\n        PyObject *e;\n        int r, n, i, n_lower;\n\t\n        n=PyObject_Length(s);\n        *d = n;\n        if(*d < 0) return -1;\n        if(nd <= 1) return 0;\n        n_lower = 0;\n        for(i=0; i<n; i++) {\n                if ((e=PySequence_GetItem(s,i)) == NULL) return -1;\n                r=discover_dimensions(e,nd-1,d+1,check_it);\n                Py_DECREF(e);\n\t\t\n                if (r == -1) return -1; \n\t\tif (check_it && n_lower != 0 && n_lower != d[1]) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"inconsistent shape in sequence\");\n\t\t\treturn -1;\n\t\t}\t\t\n                if (d[1] > n_lower) n_lower = d[1];\n        }\n        d[1] = n_lower;\n\t\n        return 0;\n}\n\nstatic void\n_array_small_type(int chktype, int mintype, int chksize, int minsize, \n\t\t  PyArray_Typecode *outtype)\n{\n\touttype->type_num = MAX(chktype, mintype);\n\tif (PyTypeNum_ISFLEXIBLE(outtype->type_num) &&\t\\\n\t    PyTypeNum_ISFLEXIBLE(mintype)) {\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 == PyArray_STRING) {\n\t\t\touttype->itemsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\touttype->itemsize = MAX(chksize, minsize);\n\t\t}\n\t}\n\telse {\n\t\touttype->itemsize = chksize;\n\t}\n\treturn;\t\n}\n\nstatic void\n_array_find_type(PyObject *op, PyArray_Typecode *minitype, \n\t\t PyArray_Typecode *outtype, int max)\n{\n        int l;\n        PyObject *ip;\n\tint chktype=0;\n\tint chksize=0;\n\tint mintype, minsize;\n\n\tif (minitype == NULL) {\n\t\tmintype = PyArray_BOOL;\n\t\tminsize = sizeof(Bool);\n\t}\n\telse {\n\t\tmintype = minitype->type_num;\n\t\tminsize = minitype->itemsize;\n\t}\n\n    \n        if (max < 0 || mintype == -1) goto deflt;\n\t\n        if (PyArray_Check(op)) {\n\t\tchktype = PyArray_TYPE(op);\n\t\tchksize = PyArray_ITEMSIZE(op);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tPyArray_TypecodeFromScalar(op, outtype);\n\t\tchktype = outtype->type_num;\n\t\tchksize = outtype->itemsize;\n\t\tgoto finish;\n\t}\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_TYPE(ip);\n\t\t\tchksize = PyArray_ITEMSIZE(ip);\n\t\t\tgoto finish;\n\t\t}\n        } \n\t\n\tif (PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tint swap=0, res;\n\t\tip = PyObject_GetAttrString(op, \"__array_typestr__\");\n\t\tif (ip && PyString_Check(ip)) {\n\t\t\tres = _array_typecode_fromstr(PyString_AS_STRING(ip), \n\t\t\t\t\t\t      &swap, outtype);   \n\t\t\tif (res >= 0) {\n\t\t\t\tPy_DECREF(ip);\n\t\t\t\tchktype = outtype->type_num;\n\t\t\t\tchksize = outtype->itemsize;\n\t\t\t\tgoto finish;\n\t\t\t}\n\t\t}\n\t\tPy_XDECREF(ip);\n\t}\n\n        if (PyString_Check(op)) {\n\t\tchktype = PyArray_STRING;\n\t\tchksize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n        }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_UNICODE;\n\t\tchksize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_VOID;\n\t\tchksize = op->ob_type->tp_as_sequence->sq_length(op);\n\t\tPyErr_Clear();\n\t\tgoto finish;\n\t}\n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n        if (PySequence_Check(op)) {\n\t\tPyArray_Typecode newtype;\n\t\tnewtype.type_num = mintype;\n\t\tnewtype.itemsize = minsize;\n\t\tnewtype.fortran = 0;\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 && mintype == 0) {\n\t\t\tnewtype.type_num = PyArray_INTP;\n\t\t\tnewtype.itemsize = sizeof(intp);\n\t\t}\n                while (--l >= 0) {\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\t_array_find_type(ip, &newtype, outtype, max-1);\n\t\t\t_array_small_type(outtype->type_num,\n\t\t\t\t\t  newtype.type_num, \n\t\t\t\t\t  outtype->itemsize,\n\t\t\t\t\t  newtype.itemsize,\n\t\t\t\t\t  &newtype);\n                        Py_DECREF(ip);\n                }\n\t\tchktype = newtype.type_num;\n\t\tchksize = newtype.itemsize;\n\t\tgoto finish;\n        }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_BOOL;\n\t\tchksize = sizeof(Bool);\n\t\tgoto finish;\t\t\n\t}\n        else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_LONG;\n\t\tchksize = sizeof(long);\n\t\tgoto finish;\n        } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DOUBLE;\n\t\tchksize = sizeof(double);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_CDOUBLE;\n\t\tchksize = sizeof(cdouble);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_OBJECT;\n\tchksize = sizeof(void *);\n\n finish:\n\t_array_small_type(chktype, mintype, chksize, minsize, \n\t\t\t  outtype);\n\treturn;\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\" */ \nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Typecode *typecode) \n{\n        PyArrayObject *ret;\n\tint itemsize = 0;\n\tint type = typecode->type_num;\n\n\tif PyTypeNum_ISFLEXIBLE(type) {\n\t\titemsize = PyObject_Length(op);\n\t}\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, 0, NULL, type,\n\t\t\t\t\t   NULL, NULL, itemsize, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n        ret->descr->setitem(op, ret->data, ret);\n\t\n        if (PyErr_Occurred()) {\n                array_dealloc(ret);\n                return NULL;\n        } else {\n                return (PyObject *)ret;\n        }\n}\n\n\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Typecode *typecode, int min_depth, \n\t\t   int max_depth)\n{\n        PyArrayObject *r;\n        int nd;\n\tintp *d;\n\tint stop_at_string;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\t\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        if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string)) > 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 ((d=PyDimMem_NEW(nd)) == NULL) {\n\t\treturn PyErr_NoMemory();\n        }\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\tPyDimMem_FREE(d);\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISFLEXIBLE(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\tPyDimMem_FREE(d);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n        r=(PyArrayObject*)PyArray_New(&PyArray_Type, nd, d, \n\t\t\t\t      type, NULL, NULL,\n\t\t\t\t      itemsize, \n\t\t\t\t      typecode->fortran, NULL);\n\n        PyDimMem_FREE(d);\n        if(!r) return NULL;\n        if(Assign_Array(r,s) == -1) {\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n        return (PyObject*)r;\n}\n\n\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) return 0;\n\treturn 1;\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->itemsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->itemsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n        PyArray_CopySwapFunc *in_csn;\n        PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->cast[out->descr->type_num];\n        in_csn = in->descr->copyswap;\n        out_csn = out->descr->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\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\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; i<el; i++) {\n                                                out_csn(it_out->dataptr,\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->itemsize * 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\n/* For backward compatibility */\n\nstatic PyObject *\nPyArray_Cast(PyArrayObject *mp, int type_num) \n{\n\tPyArray_Typecode type;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\ttype.itemsize = descr->elsize;\n\ttype.type_num = descr->type_num;\n\ttype.fortran = 0;\n\t\n\treturn PyArray_CastToType(mp, &type);\n}\n\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Typecode *at) \n{\n\tPyObject *out;\n\tint ret;\n\n\tif ((mp->descr->type_num == at->type_num) &&                    \\\n\t    (at->itemsize==0 || mp->itemsize == at->itemsize) &&\n\t    PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->itemsize == 0) {\n\t\tif (mp->descr->type_num == PyArray_STRING &&\t\\\n\t\t    at->type_num == PyArray_UNICODE)\n\t\t\tat->itemsize = mp->itemsize*sizeof(Py_UNICODE);\n\t\tif (mp->descr->type_num == PyArray_UNICODE &&\n\t\t    at->type_num == PyArray_STRING) \n\t\t\tat->itemsize = mp->itemsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->itemsize = mp->itemsize;\n\t}\n\n\tout = PyArray_New(mp->ob_type, mp->nd, \n\t\t\t  mp->dimensions, \n\t\t\t  at->type_num,\n\t\t\t  NULL, NULL, at->itemsize, \n\t\t\t  at->fortran, (PyObject *)mp);\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\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\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\tsimple =  ((PyArray_ISCARRAY(mp) && PyArray_ISCARRAY(out)) ||   \\\n                   (PyArray_ISFARRAY(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->itemsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->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\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Typecode *typecode, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Typecode oldtype;\n\tchar *msg = \"Cannot copy-back to a read-only array.\";\n        PyTypeObject *subtype;\n\n\toldtype.type_num = PyArray_TYPE(arr);\n\toldtype.itemsize = PyArray_ITEMSIZE(arr);\n\toldtype.fortran = 0;\n\n        subtype = arr->ob_type;\n\n\tif (type == PyArray_NOTYPE) type = arr->descr->type_num;\n\tif (itemsize == 0) itemsize = arr->itemsize;\n\ttypecode->type_num = type;\n\ttypecode->itemsize = itemsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivalentTypes(&oldtype, typecode)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| (PyArray_ITEMSIZE(arr) != itemsize) || \\\n\t\t\t((flags & ALIGNED) && (!(arrflags & ALIGNED))) || \\\n\t\t\t((flags & NOTSWAPPED) && (!(arrflags & NOTSWAPPED))) \\\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                                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_New(subtype, \n\t\t\t\t\t    arr->nd, \n\t\t\t\t\t    arr->dimensions,\n\t\t\t\t\t    arr->descr->type_num,\n\t\t\t\t\t    NULL, NULL, \n\t\t\t\t\t    itemsize,\n\t\t\t\t\t    flags & FORTRAN,\n\t\t\t\t\t    (PyObject *)arr);\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) 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                                ret = (PyArrayObject *) \\\n                                        PyArray_New(&PyArray_Type,\n                                                    arr->nd,\n                                                    arr->dimensions,\n                                                    arr->descr->type_num,\n                                                    arr->strides,\n                                                    arr->data,\n                                                    arr->itemsize,\n                                                    arr->flags,NULL);\n                                if (ret == NULL) return NULL;\n                                ret->base = (PyObject *)arr;\n                                ret->flags &= ~UPDATEIFCOPY;\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_CanCastSafely(PyArray_TYPE(arr), type)) {\n                        if ((flags & UPDATEIFCOPY) && \\\n                            (!PyArray_ISWRITEABLE(arr))) {\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_New(subtype, arr->nd,\n                                            arr->dimensions, typecode->type_num,\n                                            NULL, NULL, typecode->itemsize,\n                                            typecode->fortran, \n                                            (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 can not 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\nstatic int\n_array_typecode_fromstr(char *str, int *swap, PyArray_Typecode *type)\n{\n    int type_num;\n    char typechar;\n    int size;\n    unsigned long number = 1;\n    char *s;\n    char msg[] = \"unsupported typestring\";\n    \n    s = (char *)&number;   /* s[0] == 0 implies big-endian */\n\n    *swap = 0;\n\n    if (str[0] == '<' || str[0] == '>') {\n\tif ((str[0] == '<') && (s[0] == 0)) *swap = 1;\n\telse if ((str[0] == '>') && (s[0] != 0)) *swap = 1;\n    }\n    str += 1;\n    \n#define _MY_FAIL {\t\t\t\t    \\\n\t    PyErr_SetString(PyExc_ValueError, msg); \\\n\t    return -1;\t\t\t    \\\n    }\t\t\n\n    typechar = str[0];\n    size = atoi(str + 1);\n    switch (typechar) {\n    case 'b':\n\t    if (size == sizeof(Bool))\n\t\t    type_num = PyArray_BOOL;\t    \n\t    else _MY_FAIL \n\t    break;\t\t    \n    case 'u':\n            if (size == sizeof(uintp))\n                    type_num = PyArray_UINTP;\n\t    else if (size == sizeof(char))\n\t\t    type_num = PyArray_UBYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_USHORT;\n\t    else if (size == sizeof(int)) \n\t\t    type_num = PyArray_UINT;\n\t    else if (size == sizeof(ulong)) \n\t\t    type_num = PyArray_ULONG;\n\t    else if (size == sizeof(ulonglong))\n\t\t    type_num = PyArray_ULONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'i':\n            if (size == sizeof(intp))\n                    type_num = PyArray_INTP;\n\t    else if (size == sizeof(char)) \n\t\t    type_num = PyArray_BYTE;\n\t    else if (size == sizeof(short)) \n\t\t    type_num = PyArray_SHORT;\n\t    else if (size == sizeof(int))\n\t\t    type_num = PyArray_INT;\n\t    else if (size == sizeof(long)) \n\t\t    type_num = PyArray_LONG;\n\t    else if (size == sizeof(longlong))\n\t\t    type_num = PyArray_LONGLONG;\n\t    else _MY_FAIL\n\t    break;\t\t    \n    case 'f':\n\t    if (size == sizeof(float))\n\t\t    type_num = PyArray_FLOAT;\n\t    else if (size == sizeof(double))\n\t\t    type_num = PyArray_DOUBLE;\n\t    else if (size == sizeof(longdouble))\n\t\t    type_num = PyArray_LONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'c':\n\t    if (size == sizeof(float)*2)\n\t\t    type_num = PyArray_CFLOAT;\n\t    else if (size == sizeof(double)*2)\n\t\t    type_num = PyArray_CDOUBLE;\n\t    else if (size == sizeof(longdouble)*2)\n\t\t    type_num = PyArray_CLONGDOUBLE;\n\t    else _MY_FAIL\n\t    break;\n    case 'O':\n\t    if (size == sizeof(PyObject *))\n\t\t    type_num = PyArray_OBJECT;\n\t    else _MY_FAIL\n\t    break;\n    case 'S':\n\t    type_num = PyArray_STRING;\n\t    break;\n    case 'U':\n\t    type_num = PyArray_UNICODE;\n\t    size *= sizeof(Py_UNICODE);\n\t    break;\t    \n    case 'V':\n\t    type_num = PyArray_VOID;\n\t    break;\n    default:\n\t    _MY_FAIL\n    }\n\n#undef _MY_FAIL\n\n    type->type_num = type_num;\n    type->itemsize = size;\n    type->fortran = 0;\n    return 0;\n}\n\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Typecode *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n\tPyArrayObject *ret=NULL;\n\tPyArray_Typecode type;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint swap;\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\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif (attr == NULL) {\n\t\tPy_INCREF(input);\n\t\tattr = input;\n\t}\n\t\n\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n\n\tattr = PyObject_GetAttrString(input, \"__array_typestr__\");\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\t\n\t}\n\tres = _array_typecode_fromstr(PyString_AS_STRING(attr), &swap, &type);\n\tPy_DECREF(attr);\n\tif (res < 0) return NULL;\n    \n\tattr = PyObject_GetAttrString(input, \"__array_shape__\");\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple.\");\n\t\tPy_DECREF(attr);\n\t\treturn NULL;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; i<n; i++) {\n\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\tdims[i] = PyArray_PyIntAsIntp(item);\n\t\tif (error_converting(dims[i])) break;\n\t}\n\tPy_DECREF(attr);\n\tif (PyErr_Occurred()) return NULL;\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, n, dims, \n\t\t\t\t\t   type.type_num, \n\t\t\t\t\t   NULL, data, type.itemsize, \n                                           BEHAVED_FLAGS, NULL);\n\tif (ret == NULL) return NULL;\n\tPy_INCREF(input);\n\tret->base = 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\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\treturn NULL;\n\t\t}\n\t\tfor (i=0; i<n; i++) {\n\t\t\titem = PyTuple_GET_ITEM(attr, i);\n\t\t\tstrides[i] = PyArray_PyIntAsIntp(item);\n\t\t\tif (error_converting(strides[i])) break;\n\t\t}\n\t\tPy_DECREF(attr);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\t\n\t\tmemcpy(ret->strides, strides, n*sizeof(intp));\n\t}\n\n\tif (swap) {\n\t\tPyObject *tmp;\n                tmp = PyArray_Byteswap(ret, TRUE);\n\t\tPy_DECREF(tmp);\n\t}\n\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n}\n\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Typecode *typecode, int flags) \n{\n        PyObject *new, *r;\n\t        \n        if (typecode->type_num == PyArray_NOTYPE) {\n                new = PyObject_CallMethod(op, \"__array__\", NULL);\n        } else {\n                new = PyObject_CallMethod(op, \"__array__\", \"i\", \n                                          typecode->type_num);\n        }\n        if (new == NULL) 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                return NULL;\n        }\n        r = array_fromarray((PyArrayObject *)new, typecode, flags);\n        Py_DECREF(new);\n        return r;\n}        \n\n\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Typecode *typecode, 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\tint type = typecode->type_num;\n        PyObject *r=NULL;\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, typecode, flags);\n\telse if (PyObject_HasAttrString(op, \"__array__\")) {\n\t\t/* 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, typecode, flags);\n\t}\n\telse if (PyObject_HasAttrString(op, \"__array_shape__\") &&\n\t\t PyObject_HasAttrString(op, \"__array_typestr__\")) {\n\t\tr = array_frominterface(op, typecode, flags);\n\t}\n\telse {\n\t\tif (type == PyArray_NOTYPE) {\n\t\t\t_array_find_type(op, NULL, typecode, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op))\n\t\t\tr = Array_FromSequence(op, typecode, \n\t\t\t\t\t       min_depth, max_depth);\n\t\telse\n\t\t\tr = Array_FromScalar(op, typecode);\n\t}\n\n        /* If we didn't succed 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_ValueError, \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                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object of too small depth for desired array\");\n                return NULL;\n        }\n        if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n                Py_DECREF(r);\n                PyErr_SetString(PyExc_ValueError, \n                                \"Object too deep for desired array\");\n                return NULL;\n        }\n        return r;\n}\n\nstatic void\nPyArray_ArrayType(PyObject *op, PyArray_Typecode *intype, \n\t\t  PyArray_Typecode *outtype) \n{\n\t_array_find_type(op, intype, outtype, MAX_DIMS);\n\treturn;\n}\n\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Typecode intype, outtype;\n\tintype.type_num = minimum_type;\n\t_array_find_type(op, &intype, &outtype, MAX_DIMS);\n\treturn outtype.type_num;\n}\n\n\n\n/* flags is any of \n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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, NOTSWAPPED, and WRITEABLE\n   and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, the returned array will be a copy of the object, \n   (C) contiguous in memory, aligned, notswapped, and writeable.\n   \n   So  CONTIGUOUS | ENSURECOPY passed in means that the returned\n   array does not have to be CONTIGUOUS or a COPY but should be\n   ALIGNED, NOTSWAPPED and WRITEABLE.  \n\n   typecode->fortran can be set to request a\n   fortran-contiguous  array.  Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n{\n \tPyArray_Typecode mine = {PyArray_NOTYPE, 0, 0};\n\tPyArray_Typecode *type;\n\t\n\tif (typecode == NULL) type = &mine;\n\telse type = typecode;\n\t\t\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\t/* Ensure that type->fortran and flags & FORTRAN are the\n\t   same */\n\tif (requires & FORTRAN) typecode->fortran = 1;\n\tif (type->fortran == 1) {\n\t\trequires |= FARRAY_FLAGS;\n\t\tif (min_depth > 2) requires &= ~CONTIGUOUS;\n\t}\n\n\t/* make sure itemsize is not 0 unless warranted. */\n\tif ((type->itemsize == 0) && (type->type_num != PyArray_NOTYPE)) {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type->type_num);\n\t\tif (descr != NULL) type->itemsize = descr->elsize;\n\t\telse return NULL;\n\t}\n\t\n\treturn array_fromobject(op, type, 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, 0) */\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\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_FromAny(op, NULL, 0, 0, ENSUREARRAY);\n        Py_DECREF(op);\n        return new;\n}\n\n/* These are all compressed into a single API */\n/* Deprecated calls -- Use PyArray_FromAny */\n\nstatic PyObject *\nPyArray_FromObject(PyObject *op, int type, int min_depth, int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, BEHAVED_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_ContiguousFromObject(PyObject *op, int type, int min_depth, \n\t\t\t     int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS | ENSUREARRAY);\n}\n\nstatic PyObject *\nPyArray_CopyFromObject(PyObject *op, int type, int min_depth, \n\t\t       int max_depth) \n{\n\tPyArray_Typecode typecode = {0, 0, 0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth, max_depth,\n\t\t\t       ENSURECOPY | ENSUREARRAY);\n}\n\n/* End of deprecated */\n\nstatic PyObject *\nPyArray_ContiguousFromAny(PyObject *op, int type, int min_depth, \n\t\t\t  int max_depth)\n{\n\tPyArray_Typecode typecode = {0,0,0};\n\ttypecode.type_num = type;\n        return PyArray_FromAny(op, &typecode, min_depth,\n\t\t\t       max_depth, DEFAULT_FLAGS);\n}\t\n\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\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\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 (to->elsize > from->elsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (to->elsize >= from->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n                        if (from->elsize < 8)\n                                return (to->elsize > from->elsize);\n                        else\n                                return (to->elsize >= from->elsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n                        if (from->elsize < 8)\n                                return ((to->elsize >> 1) > from->elsize);\n                        else\n                                return ((to->elsize >> 1) >= from->elsize);\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 ((to->elsize >> 1) >= from->elsize);\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\nstatic Bool\nPyArray_CanCastTo(PyArray_Typecode *from, PyArray_Typecode *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->itemsize <= to->itemsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->itemsize * sizeof(Py_UNICODE)\\\n\t\t\t\t       <= to->itemsize);\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->itemsize <= to->itemsize);\n\t\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 scipy's arraymap  ****/\n/*         and Python's array iterator                                   ***/\n                     \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 = PyObject_GC_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        PyObject_GC_Track(it);\n        return (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        PyObject_GC_UnTrack(it);\n        Py_XDECREF(it->ao);\n        PyObject_GC_Del(it);\n }\n\nstatic int\narrayiter_traverse(PyArrayIterObject *it, visitproc visit, void *arg)\n{\n        if (it->ao != NULL)\n                return visit((PyObject *)(it->ao), arg);\n        return 0;\n}\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 dim\");\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->itemsize;\n\tr = PyArray_New(self->ao->ob_type, 1, &count, \n\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\titemsize, 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->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->itemsize;\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\tr = PyArray_New(self->ao->ob_type, ind->nd, ind->dimensions,\n\t\t\tself->ao->descr->type_num, NULL, \n\t\t\tNULL, self->ao->itemsize, \n\t\t\t0, (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)->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\tint i;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint 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\t\t\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\n\t/* Tuples 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\tr = PyArray_New(self->ao->ob_type, 1, &ii, \n\t\t\t\t\tself->ao->descr->type_num, NULL, \n\t\t\t\t\tNULL, self->ao->itemsize, 0,\n\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 */\n\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->itemsize;\n\t\tr = PyArray_New(self->ao->ob_type, 1, &n_steps, \n\t\t\t\tself->ao->descr->type_num, NULL, NULL,\n\t\t\t\tsize, 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)->copyswap;\n\t\twhile(n_steps--) {\n                        copyswap(dptr, self->dataptr, swap, size);\n\t\t\tfor(i=0; i< step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\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\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"unsupported iterator index\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\n fail:\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 dim\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->itemsize;\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->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n                        copyswap(self->dataptr, val->dataptr, swap,\n                                  itemsize);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index==val->size) \n\t\t\tPyArray_ITER_RESET(val);\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_Typecode typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n        PyArray_CopySwapFunc *copyswap;\n\n\titemsize = typecode.itemsize = self->ao->itemsize;\n\ttypecode.type_num = self->ao->descr->type_num;\n        copyswap = self->ao->descr->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\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tint i;\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Typecode type;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tint swap;\n\tint itemsize;\n\tint start, step_size;\n\tintp n_steps;\n\tPyObject *obj;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\ti = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn i;\n\t}\n\t\n\ttype.type_num = self->ao->descr->type_num;\n\titemsize = type.itemsize = self->ao->itemsize;\n\t\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 fail;\n\n\t/* Check for Boolean -- this is first becasue\n\t   Bool is a subclass of Int */\n\n        copyswap = PyArray_DESCR(arrval)->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\tgoto succeed;\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 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                        copyswap(self->dataptr, PyArray_DATA(arrval),\n                                  swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tgoto succeed;\n\t\t}\n\t\twhile(n_steps--) {\n                        copyswap(self->dataptr, val_it->dataptr,\n                                  swap, itemsize);\n\t\t\tfor(i=0; i < step_size; i++) \n\t\t\t\tPyArray_ITER_NEXT(self);\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\tgoto succeed;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tif (PyArray_IsScalar(ind, Integer))\n\t\tobj = PyArray_FromScalar(ind, &indtype);\n\telse if (PyList_Check(ind)) {\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 fail;\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 | BEHAVED_FLAGS);\n\t\t\tif (new==NULL) goto fail;\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\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 fail;\n\t\t}\n\t\telse goto fail;\n\t\tPy_DECREF(obj);\n\t\tgoto succeed;\n\t}\n\n\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tgoto fail;\n\n succeed:\n\tPy_DECREF(val_it);\n\tPy_DECREF(arrval);\n\treturn 0;\n\n fail:\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn -1;\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        if (PyArray_ISCONTIGUOUS(it->ao)) {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, it->ao->data, it->ao->itemsize, \n\t\t\t\tit->ao->flags,\n                                (PyObject *)it->ao);                \n\t\tif (r==NULL) return NULL;\n        }\n        else {\n                r = PyArray_New(it->ao->ob_type, 1, &size, \n\t\t\t\tit->ao->descr->type_num,\n                                NULL, NULL, it->ao->itemsize, 0, \n                                (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\n\nstatic PyTypeObject PyArrayIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arrayiter_traverse,\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)arrayiter_next,\t\t/* tp_iternext */\n        iter_methods,\t\t\t\t/* tp_methods */\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<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(args,i);\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t\t\telse {\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj))\n\t\t\t\tretval = SOBJ_ISFANCY;\n\t\t}\n\t}\t\n\telse if (PyArray_Check(args)) {\n\t\tif ((PyArray_TYPE(args)==PyArray_BOOL) ||\n\t\t    (PyArray_ISINTEGER(args)))\n\t\t\treturn SOBJ_ISFANCY;\n\t\telse\n\t\t\treturn SOBJ_BADARRAY;\n\t}\n\telse if (PySequence_Check(args)) {\n\t\t/* Sequences < MAX_DMS with any slice objects\n\t\t   or NewAxis, or Ellipsis is considered standard\n\t\t   as long as there are also no Arrays and or additional\n\t\t   sequences embedded.\n\t\t*/\n\t\tretval = SOBJ_ISFANCY;\n\t\tn = PySequence_Size(args);\n\t\tif (n<0 || n>=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PySequence_GetItem(args, i);\n\t\t\tif (obj == NULL) return SOBJ_ISFANCY;\n\t\t\tif (PyArray_Check(obj)) {\n\t\t\t\tif (PyArray_ISINTEGER(obj))\n\t\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t\telse\n\t\t\t\t\tretval = SOBJ_BADARRAY;\n\t\t\t}\n\t\t\telse if (PySequence_Check(obj)) {\n\t\t\t\tretval = SOBJ_LISTTUP;\n\t\t\t}\n\t\t\telse if (PySlice_Check(obj) || obj == Py_Ellipsis || \\\n\t\t\t    obj == Py_None) {\n\t\t\t\tretval = SOBJ_NOTFANCY;\n\t\t\t}\n\t\t\tPy_DECREF(obj);\n\t\t\tif (retval > 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_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\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 */\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; i<mit->numiter; 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; i<nd; i++) {\n\t\tmit->dimensions[i] = 1;\n\t\tfor (j=0; j<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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->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; i<mit->numiter; 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; i<mit->numiter; 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=NULL, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\n\t/* Remove old binding if any */\n\tPy_XDECREF(mit->ait);\n\tmit->ait = NULL;\n\n\tPy_XDECREF(mit->subspace);\n\tmit->subspace = NULL;\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.  Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tmit->iteraxes[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\tif (mit->subspace == NULL) goto fail;\n\tPy_DECREF(sub);\n\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; i<n; i++) \n\t\tmit->dimensions[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; i<n; i++) {\n\t\t/* We need to fill in the starting coordinates for\n\t\t   the subspace */\n\t\tobj = PyTuple_GET_ITEM(mit->indexobj, 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\tint start=0;\n\t\t\tint 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; i<mit->numiter; 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}\t\t\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(sub);\n\tPy_XDECREF(mit->ait);\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_Typecode typecode = {PyArray_BOOL, 0, 0};\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\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; j<nd; j++) iters[j] = NULL;\n\tsize = PyArray_SIZE(ba);\n\tptr = (Bool *)ba->data;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; i<size; i++) \n\t\tif (*(ptr++)) count++;\n\n\t/* create count-sized index arrays for each dimension */\n\tfor (j=0; j<nd; j++) {\n\t\tnew = (PyArrayObject *)PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t\t\t   PyArray_INTP, NULL, NULL, \n\t\t\t\t\t\t   0, 0, NULL);\n\t\tif (new == NULL) goto fail;\n\t\titers[j] = (PyArrayIterObject *)\t\\\n\t\t\tPyArray_IterNew((PyObject *)new);\n\t\tPy_DECREF(new);\n\t\tif (iters[j] == NULL) goto fail;\n\t\tdptr[j] = (intp *)iters[j]->ao->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) return nd;\n\n\t/* Loop through the Boolean array  and copy coordinates\n\t   for non-zero entries */\n\tfor (i=0; i<size; i++) {\n\t\tif (*(ptr++)) {\n\t\t\tfor (j=0; j<nd; j++) \n\t\t\t\t*(dptr[j]++) = coords[j];\n\t\t}\n\t\t/* Borrowed from ITER_NEXT macro */\n\t\tfor (j=nd-1; j>=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\treturn nd;\n\n fail:\n\tfor (j=0; j<nd; j++) {\n\t\tPy_XDECREF(iters[j]);\n\t}\n\tPy_XDECREF(ba);\n\treturn -1;\n\n}\n\nstatic PyObject *\nPyArray_MapIterNew(PyObject *indexobj)\n{\n        PyArrayMapIterObject *mit;\n\tint fancy=0;\n\tPyArray_Typecode indtype = {PyArray_INTP, 0, 0};\n\tPyObject *arr = NULL;\n\tint i, n, started, nonindex;\n\n        mit = PyObject_GC_New(PyArrayMapIterObject, &PyArrayMapIter_Type);\n        if (mit == NULL)\n                return NULL;\n\tfor (i=0; i<MAX_DIMS; i++)\n\t\tmit->iters[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_TypeError,\t\t\t\\\n\t\t\t\t\"Arrays used as indexes 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_TypeError,\"Too many indicies\");\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\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\tfor (i=0; i<mit->numiter; 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 (PyList_Check(indexobj) || PyArray_Check(indexobj)) {\n\t\tmit->numiter = 1;\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\tPy_DECREF(arr);\n\t\tif (mit->iters[0] == NULL) 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(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\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; i<n; i++) {\n\t\t\tobj = PyTuple_GET_ITEM(indexobj,i);\n\t\t\tif (_convert_obj(obj, &iter) < 0)\n\t\t\t\tgoto fail;\n\t\t\tif (iter!= NULL) { \n\t\t\t\tstarted = 1;\n\t\t\t\tif (nonindex) mit->consec = 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\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        PyObject_GC_Track(mit);\n        return (PyObject *)mit;\n       \n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n\treturn NULL;\n}\n\n\n/* return unbound mapiter object */\n\nstatic PyObject *\narraymapiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) \n{\n\tPyObject *newtup, *res;\n\tint n;\n\n\tif (!PyTuple_Check(args)) {\n\t\tPyErr_BadInternalCall();\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_GET_SIZE(args);\n\t\n\tif (n < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"must be initialized with >= 1 argument\");\n\t\treturn NULL;\n\t}\n\t\n\tif (n > 1) {\n\t\tnewtup = PyTuple_GetSlice(args, 0, n);\n\t\tif (newtup == NULL) return NULL;\n\t\tres = PyArray_MapIterNew(newtup);\n\t\tPy_DECREF(newtup);\n\t}\n\telse {  /* n == 1 */\n\t\tnewtup = PyTuple_GET_ITEM(args, 0);\n\t\tres = PyArray_MapIterNew(newtup);\n\t}\n\n\treturn res; \t\n}\n\n\n/* Returns a 0-dim array holding the element desired */\n/*\nstatic PyObject *\narraymapiter_next(PyArrayMapIterObject *mit)\n{\n\tPyObject *ret;\n\tif (mit->ait == NULL) return NULL;\n\tif (mit->view) return NULL;\n\tif (mit->index < mit->size) {\n\t\tret = PyArray_ToScalar(mit->dataptr, mit->ait->ao);\n\t\tPyArray_MapIterNext(mit);\n\t\treturn ret;\n\t}\n        return NULL;\n}\n*/\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n        PyObject_GC_UnTrack(mit);\n        Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->indexobj);\n\tfor (i=0; i<mit->numiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n        PyObject_GC_Del(mit);\n}\n\nstatic int\narraymapiter_traverse(PyArrayMapIterObject *mit, visitproc visit, void *arg)\n{\n\tint ret, i;\n        if (mit->ait != NULL)\n                if ((ret = visit((PyObject *)(mit->ait), arg)) != 0) \n\t\t\treturn ret;\t\n\n\tif (mit->iters != NULL) \n\t\tfor (i=0; i<mit->numiter; i++) \n\t\t\tif (mit->iters[i] != NULL) \n\t\t\t\tif ((ret=visit((PyObject *)mit->iters[i], \n\t\t\t\t\t       arg)) != 0)\n\t\t\t\t\treturn ret;\n\n\tif (mit->indexobj != NULL)\n\t\tif ((ret = visit(mit->indexobj, arg)) != 0) return ret;\n\t\n        return 0;\n}\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 MapIterNew must be \n   that does not work.  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 char doc_mapiter_bind[] = \"obj.bind(a)\\n Bind an array to the \"\\\n\t\"mapiter object\";\n\nstatic PyObject *\nmapiter_bind(PyArrayMapIterObject *mit, PyObject *args)\n{\n\tPyArrayObject *arr;\n\n        if (!PyArg_ParseTuple(args, \"O!\", &PyArray_Type, &arr)) return NULL;\n\n \tPyArray_MapIterBind(mit, arr);\n\n\tif (mit->ait == NULL) return NULL;\n\t\n \tPyArray_MapIterReset(mit);\n\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef mapiter_methods[] = {\n\t{\"bind\", (PyCFunction)mapiter_bind, 1, doc_mapiter_bind},\n        {NULL,\t\tNULL}\t\t\n};\n*/\n\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t /* ob_size */\n        \"scipy.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 | Py_TPFLAGS_HAVE_GC,/* tp_flags */\n        0,\t\t\t\t\t/* tp_doc */\n        (traverseproc)arraymapiter_traverse,\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, /*arraymapiter_next,*/\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        (newfunc)arraymapiter_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\n/** END of Subscript Iterator **/\n\n\n\n",
                "methods": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1592,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1595,
                        "end_line": 1654,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1675,
                        "end_line": 1750,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1763,
                        "end_line": 1815,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1823,
                        "end_line": 1826,
                        "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": 1845,
                        "end_line": 1857,
                        "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": 1860,
                        "end_line": 1875,
                        "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": 1879,
                        "end_line": 1888,
                        "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": 1891,
                        "end_line": 1902,
                        "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": 1970,
                        "end_line": 2003,
                        "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": 2010,
                        "end_line": 2049,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2052,
                        "end_line": 2071,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2075,
                        "end_line": 2094,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2098,
                        "end_line": 2109,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2112,
                        "end_line": 2123,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2126,
                        "end_line": 2138,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2141,
                        "end_line": 2144,
                        "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": 2147,
                        "end_line": 2150,
                        "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": 2153,
                        "end_line": 2156,
                        "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": 2159,
                        "end_line": 2162,
                        "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": 2165,
                        "end_line": 2168,
                        "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": 2171,
                        "end_line": 2174,
                        "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": 2177,
                        "end_line": 2180,
                        "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": 2183,
                        "end_line": 2186,
                        "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": 2189,
                        "end_line": 2192,
                        "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": 2195,
                        "end_line": 2198,
                        "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": 2201,
                        "end_line": 2204,
                        "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": 2207,
                        "end_line": 2210,
                        "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": 2213,
                        "end_line": 2216,
                        "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": 2219,
                        "end_line": 2222,
                        "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": 2225,
                        "end_line": 2228,
                        "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": 2231,
                        "end_line": 2234,
                        "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": 2237,
                        "end_line": 2240,
                        "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": 2243,
                        "end_line": 2246,
                        "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": 2249,
                        "end_line": 2252,
                        "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": 2255,
                        "end_line": 2258,
                        "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": 2261,
                        "end_line": 2264,
                        "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": 2267,
                        "end_line": 2270,
                        "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": 2273,
                        "end_line": 2276,
                        "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": 2279,
                        "end_line": 2282,
                        "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": 2285,
                        "end_line": 2288,
                        "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": 2291,
                        "end_line": 2294,
                        "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": 2297,
                        "end_line": 2300,
                        "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": 2303,
                        "end_line": 2307,
                        "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": 2310,
                        "end_line": 2314,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2318,
                        "end_line": 2336,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2339,
                        "end_line": 2354,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2358,
                        "end_line": 2384,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2387,
                        "end_line": 2412,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2415,
                        "end_line": 2437,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2440,
                        "end_line": 2462,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2465,
                        "end_line": 2487,
                        "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": 2490,
                        "end_line": 2494,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2555,
                        "end_line": 2593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2597,
                        "end_line": 2618,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2621,
                        "end_line": 2626,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2647,
                        "end_line": 2694,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2697,
                        "end_line": 2733,
                        "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": 2739,
                        "end_line": 2756,
                        "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": 2759,
                        "end_line": 2771,
                        "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": 2774,
                        "end_line": 2786,
                        "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": 2790,
                        "end_line": 2867,
                        "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": 2870,
                        "end_line": 2899,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2905,
                        "end_line": 2921,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2926,
                        "end_line": 2949,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2955,
                        "end_line": 2971,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2975,
                        "end_line": 2991,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2995,
                        "end_line": 3011,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3014,
                        "end_line": 3047,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3051,
                        "end_line": 3073,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3080,
                        "end_line": 3095,
                        "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": 3115,
                        "end_line": 3139,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3143,
                        "end_line": 3286,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3291,
                        "end_line": 3396,
                        "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": 3400,
                        "end_line": 3417,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3421,
                        "end_line": 3536,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3543,
                        "end_line": 3546,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3549,
                        "end_line": 3559,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3632,
                        "end_line": 3635,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3639,
                        "end_line": 3673,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3677,
                        "end_line": 3680,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3683,
                        "end_line": 3716,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3720,
                        "end_line": 3727,
                        "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": 3730,
                        "end_line": 3738,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3742,
                        "end_line": 3745,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "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": 3748,
                        "end_line": 3762,
                        "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": 3765,
                        "end_line": 3809,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3813,
                        "end_line": 3816,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3819,
                        "end_line": 3826,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3830,
                        "end_line": 3837,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3840,
                        "end_line": 3860,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3863,
                        "end_line": 3885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3888,
                        "end_line": 3891,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3895,
                        "end_line": 3898,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3910,
                        "end_line": 3968,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3973,
                        "end_line": 3983,
                        "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": 3987,
                        "end_line": 4012,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4016,
                        "end_line": 4048,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4051,
                        "end_line": 4086,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4089,
                        "end_line": 4126,
                        "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": 4129,
                        "end_line": 4132,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4135,
                        "end_line": 4189,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4368,
                        "end_line": 4393,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4396,
                        "end_line": 4418,
                        "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": 4425,
                        "end_line": 4451,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4454,
                        "end_line": 4474,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4477,
                        "end_line": 4618,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4621,
                        "end_line": 4644,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4648,
                        "end_line": 4671,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4675,
                        "end_line": 4732,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4736,
                        "end_line": 4743,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4749,
                        "end_line": 4839,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4845,
                        "end_line": 4856,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4859,
                        "end_line": 4894,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4901,
                        "end_line": 4947,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4950,
                        "end_line": 5081,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5085,
                        "end_line": 5190,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 22,
                        "token_count": 619,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5193,
                        "end_line": 5301,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 109,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5304,
                        "end_line": 5325,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5329,
                        "end_line": 5391,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5394,
                        "end_line": 5399,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5402,
                        "end_line": 5408,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5462,
                        "end_line": 5492,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5503,
                        "end_line": 5519,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5525,
                        "end_line": 5531,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5534,
                        "end_line": 5541,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5544,
                        "end_line": 5551,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromAny",
                        "long_name": "PyArray_ContiguousFromAny( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5556,
                        "end_line": 5563,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5566,
                        "end_line": 5649,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5652,
                        "end_line": 5676,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5686,
                        "end_line": 5723,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5728,
                        "end_line": 5738,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5741,
                        "end_line": 5746,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5749,
                        "end_line": 5754,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5758,
                        "end_line": 5761,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5765,
                        "end_line": 5813,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5816,
                        "end_line": 5869,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5873,
                        "end_line": 5992,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5996,
                        "end_line": 6028,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6031,
                        "end_line": 6073,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6077,
                        "end_line": 6199,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6212,
                        "end_line": 6254,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6259,
                        "end_line": 6263,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6328,
                        "end_line": 6389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6397,
                        "end_line": 6412,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6418,
                        "end_line": 6487,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6491,
                        "end_line": 6528,
                        "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": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6534,
                        "end_line": 6578,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6596,
                        "end_line": 6732,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6738,
                        "end_line": 6807,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6810,
                        "end_line": 6943,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6949,
                        "end_line": 6979,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 7000,
                        "end_line": 7009,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 7012,
                        "end_line": 7030,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "PyArray_PyIntAsIntp",
                        "long_name": "PyArray_PyIntAsIntp( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 59,
                        "complexity": 19,
                        "token_count": 385,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 40,
                        "end_line": 103,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 64,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_PyIntAsInt",
                        "long_name": "PyArray_PyIntAsInt( PyObject * o)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 19,
                        "token_count": 389,
                        "parameters": [
                            "o"
                        ],
                        "start_line": 109,
                        "end_line": 169,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 61,
                        "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": 34,
                        "complexity": 6,
                        "token_count": 190,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 208,
                        "end_line": 243,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_One",
                        "long_name": "PyArray_One( PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 7,
                        "token_count": 222,
                        "parameters": [
                            "arr"
                        ],
                        "start_line": 246,
                        "end_line": 289,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 295,
                        "end_line": 345,
                        "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": 368,
                        "end_line": 399,
                        "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": 213,
                        "parameters": [
                            "src"
                        ],
                        "start_line": 402,
                        "end_line": 436,
                        "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": 449,
                        "end_line": 471,
                        "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": 474,
                        "end_line": 495,
                        "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": 499,
                        "end_line": 537,
                        "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": 542,
                        "end_line": 562,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "index2ptr",
                        "long_name": "index2ptr( PyArrayObject * mp , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 7,
                        "token_count": 86,
                        "parameters": [
                            "mp",
                            "i"
                        ],
                        "start_line": 570,
                        "end_line": 580,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 427,
                        "parameters": [
                            "dest",
                            "src"
                        ],
                        "start_line": 604,
                        "end_line": 684,
                        "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": 16,
                        "complexity": 2,
                        "token_count": 98,
                        "parameters": [
                            "dest",
                            "src_object"
                        ],
                        "start_line": 688,
                        "end_line": 707,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndDataAndDescr",
                        "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 144,
                        "parameters": [
                            "nd",
                            "d",
                            "descr",
                            "data"
                        ],
                        "start_line": 715,
                        "end_line": 736,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDimsAndData",
                        "long_name": "PyArray_FromDimsAndData( int nd , int * d , int type , char * data)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 137,
                        "parameters": [
                            "nd",
                            "d",
                            "type",
                            "data"
                        ],
                        "start_line": 740,
                        "end_line": 760,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromDims",
                        "long_name": "PyArray_FromDims( int nd , int * d , int type)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 133,
                        "parameters": [
                            "nd",
                            "d",
                            "type"
                        ],
                        "start_line": 764,
                        "end_line": 781,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Copy",
                        "long_name": "PyArray_Copy( PyArrayObject * m1)",
                        "filename": "arrayobject.c",
                        "nloc": 11,
                        "complexity": 2,
                        "token_count": 77,
                        "parameters": [
                            "m1"
                        ],
                        "start_line": 787,
                        "end_line": 799,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Scalar",
                        "long_name": "PyArray_Scalar( char * data , int type_num , int itemsize , int swap)",
                        "filename": "arrayobject.c",
                        "nloc": 48,
                        "complexity": 8,
                        "token_count": 289,
                        "parameters": [
                            "data",
                            "type_num",
                            "itemsize",
                            "swap"
                        ],
                        "start_line": 805,
                        "end_line": 854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToScalar",
                        "long_name": "PyArray_ToScalar( char * data , PyArrayObject * arr)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "data",
                            "arr"
                        ],
                        "start_line": 861,
                        "end_line": 868,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Return",
                        "long_name": "PyArray_Return( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 17,
                        "complexity": 5,
                        "token_count": 85,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 874,
                        "end_line": 893,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDataType",
                        "long_name": "PyArray_RegisterDataType( PyTypeObject * type)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 6,
                        "token_count": 177,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 904,
                        "end_line": 936,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_RegisterDescrForType",
                        "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)",
                        "filename": "arrayobject.c",
                        "nloc": 32,
                        "complexity": 3,
                        "token_count": 167,
                        "parameters": [
                            "typenum",
                            "descr"
                        ],
                        "start_line": 946,
                        "end_line": 989,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "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": 16,
                        "token_count": 577,
                        "parameters": [
                            "self",
                            "fp",
                            "sep",
                            "format"
                        ],
                        "start_line": 993,
                        "end_line": 1084,
                        "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": 24,
                        "complexity": 5,
                        "token_count": 151,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1087,
                        "end_line": 1115,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 29,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ToString",
                        "long_name": "PyArray_ToString( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 191,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 1118,
                        "end_line": 1153,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 1162,
                        "end_line": 1199,
                        "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": 1206,
                        "end_line": 1214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_item",
                        "long_name": "array_item( PyArrayObject * self , int i)",
                        "filename": "arrayobject.c",
                        "nloc": 22,
                        "complexity": 4,
                        "token_count": 150,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1218,
                        "end_line": 1242,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "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": 26,
                        "parameters": [
                            "self",
                            "i"
                        ],
                        "start_line": 1245,
                        "end_line": 1248,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_item",
                        "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)",
                        "filename": "arrayobject.c",
                        "nloc": 27,
                        "complexity": 8,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "i",
                            "v"
                        ],
                        "start_line": 1252,
                        "end_line": 1282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "slice_coerce_index",
                        "long_name": "slice_coerce_index( PyObject * o , int * v)",
                        "filename": "arrayobject.c",
                        "nloc": 9,
                        "complexity": 2,
                        "token_count": 40,
                        "parameters": [
                            "o",
                            "v"
                        ],
                        "start_line": 1286,
                        "end_line": 1294,
                        "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 , int length , int * start , int * stop , int * step , intp * slicelength)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 24,
                        "token_count": 376,
                        "parameters": [
                            "r",
                            "length",
                            "start",
                            "stop",
                            "step",
                            "slicelength"
                        ],
                        "start_line": 1300,
                        "end_line": 1350,
                        "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 , int * step_size , intp * n_steps , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 45,
                        "complexity": 11,
                        "token_count": 223,
                        "parameters": [
                            "op",
                            "step_size",
                            "n_steps",
                            "max"
                        ],
                        "start_line": 1357,
                        "end_line": 1402,
                        "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": 89,
                        "complexity": 20,
                        "token_count": 540,
                        "parameters": [
                            "self",
                            "op",
                            "dimensions",
                            "strides",
                            "offset_ptr"
                        ],
                        "start_line": 1406,
                        "end_line": 1501,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_swap_axes",
                        "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 4,
                        "token_count": 187,
                        "parameters": [
                            "mit",
                            "ret"
                        ],
                        "start_line": 1504,
                        "end_line": 1538,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GetMap",
                        "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 36,
                        "complexity": 8,
                        "token_count": 252,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 1543,
                        "end_line": 1592,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 50,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_SetMap",
                        "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 50,
                        "complexity": 12,
                        "token_count": 392,
                        "parameters": [
                            "mit",
                            "op"
                        ],
                        "start_line": 1595,
                        "end_line": 1654,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 60,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_subscript",
                        "long_name": "array_subscript( PyArrayObject * self , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 61,
                        "complexity": 19,
                        "token_count": 425,
                        "parameters": [
                            "self",
                            "op"
                        ],
                        "start_line": 1675,
                        "end_line": 1750,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 76,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_ass_sub",
                        "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 43,
                        "complexity": 9,
                        "token_count": 251,
                        "parameters": [
                            "self",
                            "index",
                            "op"
                        ],
                        "start_line": 1763,
                        "end_line": 1815,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 1823,
                        "end_line": 1826,
                        "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": 1845,
                        "end_line": 1857,
                        "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": 1860,
                        "end_line": 1875,
                        "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": 1879,
                        "end_line": 1888,
                        "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": 1891,
                        "end_line": 1902,
                        "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": 1970,
                        "end_line": 2003,
                        "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": 2010,
                        "end_line": 2049,
                        "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": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2052,
                        "end_line": 2071,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericAccumulateFunction",
                        "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)",
                        "filename": "arrayobject.c",
                        "nloc": 20,
                        "complexity": 5,
                        "token_count": 121,
                        "parameters": [
                            "m1",
                            "op",
                            "axis",
                            "rtype"
                        ],
                        "start_line": 2075,
                        "end_line": 2094,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 20,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericBinaryFunction",
                        "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 69,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2098,
                        "end_line": 2109,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericUnaryFunction",
                        "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 63,
                        "parameters": [
                            "m1",
                            "op"
                        ],
                        "start_line": 2112,
                        "end_line": 2123,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_GenericInplaceBinaryFunction",
                        "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 13,
                        "complexity": 2,
                        "token_count": 71,
                        "parameters": [
                            "m1",
                            "m2",
                            "op"
                        ],
                        "start_line": 2126,
                        "end_line": 2138,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 2141,
                        "end_line": 2144,
                        "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": 2147,
                        "end_line": 2150,
                        "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": 2153,
                        "end_line": 2156,
                        "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": 2159,
                        "end_line": 2162,
                        "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": 2165,
                        "end_line": 2168,
                        "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": 2171,
                        "end_line": 2174,
                        "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": 2177,
                        "end_line": 2180,
                        "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": 2183,
                        "end_line": 2186,
                        "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": 2189,
                        "end_line": 2192,
                        "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": 2195,
                        "end_line": 2198,
                        "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": 2201,
                        "end_line": 2204,
                        "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": 2207,
                        "end_line": 2210,
                        "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": 2213,
                        "end_line": 2216,
                        "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": 2219,
                        "end_line": 2222,
                        "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": 2225,
                        "end_line": 2228,
                        "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": 2231,
                        "end_line": 2234,
                        "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": 2237,
                        "end_line": 2240,
                        "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": 2243,
                        "end_line": 2246,
                        "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": 2249,
                        "end_line": 2252,
                        "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": 2255,
                        "end_line": 2258,
                        "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": 2261,
                        "end_line": 2264,
                        "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": 2267,
                        "end_line": 2270,
                        "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": 2273,
                        "end_line": 2276,
                        "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": 2279,
                        "end_line": 2282,
                        "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": 2285,
                        "end_line": 2288,
                        "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": 2291,
                        "end_line": 2294,
                        "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": 2297,
                        "end_line": 2300,
                        "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": 2303,
                        "end_line": 2307,
                        "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": 2310,
                        "end_line": 2314,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 5,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_all_nonzero",
                        "long_name": "array_all_nonzero( PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 18,
                        "complexity": 4,
                        "token_count": 93,
                        "parameters": [
                            "mp"
                        ],
                        "start_line": 2318,
                        "end_line": 2336,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "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": 2339,
                        "end_line": 2354,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2358,
                        "end_line": 2384,
                        "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": 143,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2387,
                        "end_line": 2412,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2415,
                        "end_line": 2437,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2440,
                        "end_line": 2462,
                        "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": 124,
                        "parameters": [
                            "v"
                        ],
                        "start_line": 2465,
                        "end_line": 2487,
                        "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": 2490,
                        "end_line": 2494,
                        "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": 34,
                        "complexity": 11,
                        "token_count": 258,
                        "parameters": [
                            "self",
                            "ilow",
                            "ihigh"
                        ],
                        "start_line": 2555,
                        "end_line": 2593,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 39,
                        "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": 2597,
                        "end_line": 2618,
                        "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": 4,
                        "complexity": 1,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "el"
                        ],
                        "start_line": 2621,
                        "end_line": 2626,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 308,
                        "parameters": [
                            "string",
                            "n",
                            "max_n",
                            "data",
                            "nd",
                            "dimensions",
                            "strides",
                            "self"
                        ],
                        "start_line": 2647,
                        "end_line": 2694,
                        "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": 222,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 2697,
                        "end_line": 2733,
                        "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": 2739,
                        "end_line": 2756,
                        "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": 2759,
                        "end_line": 2771,
                        "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": 2774,
                        "end_line": 2786,
                        "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": 2790,
                        "end_line": 2867,
                        "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": 2870,
                        "end_line": 2899,
                        "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": 17,
                        "complexity": 4,
                        "token_count": 91,
                        "parameters": [
                            "len",
                            "vals"
                        ],
                        "start_line": 2905,
                        "end_line": 2921,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 2926,
                        "end_line": 2949,
                        "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": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2955,
                        "end_line": 2971,
                        "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": 107,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2975,
                        "end_line": 2991,
                        "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": 14,
                        "complexity": 4,
                        "token_count": 110,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 2995,
                        "end_line": 3011,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_IsWriteable",
                        "long_name": "_IsWriteable( PyArrayObject * ap)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 8,
                        "token_count": 109,
                        "parameters": [
                            "ap"
                        ],
                        "start_line": 3014,
                        "end_line": 3047,
                        "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": 22,
                        "complexity": 9,
                        "token_count": 129,
                        "parameters": [
                            "ret",
                            "flagmask"
                        ],
                        "start_line": 3051,
                        "end_line": 3073,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "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": 3080,
                        "end_line": 3095,
                        "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": 3115,
                        "end_line": 3139,
                        "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 , char * data , int itemsize , int flags , PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 27,
                        "token_count": 696,
                        "parameters": [
                            "subtype",
                            "nd",
                            "dims",
                            "type_num",
                            "strides",
                            "data",
                            "itemsize",
                            "flags",
                            "obj"
                        ],
                        "start_line": 3143,
                        "end_line": 3286,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 144,
                        "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": 501,
                        "parameters": [
                            "self",
                            "newshape"
                        ],
                        "start_line": 3291,
                        "end_line": 3396,
                        "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": 3400,
                        "end_line": 3417,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_new",
                        "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 100,
                        "complexity": 20,
                        "token_count": 589,
                        "parameters": [
                            "subtype",
                            "args",
                            "kwds"
                        ],
                        "start_line": 3421,
                        "end_line": 3536,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 116,
                        "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": 3543,
                        "end_line": 3546,
                        "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": 10,
                        "complexity": 3,
                        "token_count": 57,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3549,
                        "end_line": 3559,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "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": 3632,
                        "end_line": 3635,
                        "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": 33,
                        "complexity": 6,
                        "token_count": 206,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 3639,
                        "end_line": 3673,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 3677,
                        "end_line": 3680,
                        "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": 32,
                        "complexity": 7,
                        "token_count": 209,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 3683,
                        "end_line": 3716,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "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": 3720,
                        "end_line": 3727,
                        "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": 3730,
                        "end_line": 3738,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "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": 3742,
                        "end_line": 3756,
                        "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": 3759,
                        "end_line": 3803,
                        "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": 19,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3807,
                        "end_line": 3810,
                        "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": 8,
                        "complexity": 3,
                        "token_count": 45,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3813,
                        "end_line": 3820,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typechar_get",
                        "long_name": "array_typechar_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 47,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3824,
                        "end_line": 3831,
                        "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": 19,
                        "complexity": 7,
                        "token_count": 141,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3834,
                        "end_line": 3854,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_descr_get",
                        "long_name": "array_descr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 128,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3857,
                        "end_line": 3879,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 23,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_typenum_get",
                        "long_name": "array_typenum_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 21,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3882,
                        "end_line": 3885,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_get",
                        "long_name": "array_type_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3889,
                        "end_line": 3892,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_type_set",
                        "long_name": "array_type_set( PyArrayObject * self , PyObject * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 41,
                        "complexity": 10,
                        "token_count": 294,
                        "parameters": [
                            "self",
                            "arg"
                        ],
                        "start_line": 3904,
                        "end_line": 3962,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 59,
                        "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": 3967,
                        "end_line": 3977,
                        "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": 3981,
                        "end_line": 4006,
                        "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": 31,
                        "complexity": 4,
                        "token_count": 177,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4010,
                        "end_line": 4042,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_imag_get",
                        "long_name": "array_imag_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 3,
                        "token_count": 200,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 4045,
                        "end_line": 4080,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "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": 203,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4083,
                        "end_line": 4120,
                        "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": 4123,
                        "end_line": 4126,
                        "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": 51,
                        "complexity": 9,
                        "token_count": 368,
                        "parameters": [
                            "self",
                            "val"
                        ],
                        "start_line": 4129,
                        "end_line": 4183,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 55,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "discover_depth",
                        "long_name": "discover_depth( PyObject * s , int max , int stop_at_string)",
                        "filename": "arrayobject.c",
                        "nloc": 23,
                        "complexity": 14,
                        "token_count": 169,
                        "parameters": [
                            "s",
                            "max",
                            "stop_at_string"
                        ],
                        "start_line": 4362,
                        "end_line": 4387,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "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": 4390,
                        "end_line": 4412,
                        "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": 4419,
                        "end_line": 4445,
                        "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( int chktype , int mintype , int chksize , int minsize , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 5,
                        "token_count": 100,
                        "parameters": [
                            "chktype",
                            "mintype",
                            "chksize",
                            "minsize",
                            "outtype"
                        ],
                        "start_line": 4448,
                        "end_line": 4468,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_find_type",
                        "long_name": "_array_find_type( PyObject * op , PyArray_Typecode * minitype , PyArray_Typecode * outtype , int max)",
                        "filename": "arrayobject.c",
                        "nloc": 126,
                        "complexity": 28,
                        "token_count": 671,
                        "parameters": [
                            "op",
                            "minitype",
                            "outtype",
                            "max"
                        ],
                        "start_line": 4471,
                        "end_line": 4612,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 142,
                        "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": 4615,
                        "end_line": 4638,
                        "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_Typecode * typecode)",
                        "filename": "arrayobject.c",
                        "nloc": 19,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode"
                        ],
                        "start_line": 4642,
                        "end_line": 4665,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "Array_FromSequence",
                        "long_name": "Array_FromSequence( PyObject * s , PyArray_Typecode * typecode , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 17,
                        "token_count": 313,
                        "parameters": [
                            "s",
                            "typecode",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 4669,
                        "end_line": 4726,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 58,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ValidType",
                        "long_name": "PyArray_ValidType( int type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 30,
                        "parameters": [
                            "type"
                        ],
                        "start_line": 4730,
                        "end_line": 4737,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_bufferedcast",
                        "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)",
                        "filename": "arrayobject.c",
                        "nloc": 75,
                        "complexity": 16,
                        "token_count": 477,
                        "parameters": [
                            "out",
                            "in"
                        ],
                        "start_line": 4743,
                        "end_line": 4833,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 91,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_Cast",
                        "long_name": "PyArray_Cast( PyArrayObject * mp , int type_num)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 56,
                        "parameters": [
                            "mp",
                            "type_num"
                        ],
                        "start_line": 4839,
                        "end_line": 4850,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 12,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastToType",
                        "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Typecode * at)",
                        "filename": "arrayobject.c",
                        "nloc": 31,
                        "complexity": 13,
                        "token_count": 233,
                        "parameters": [
                            "mp",
                            "at"
                        ],
                        "start_line": 4853,
                        "end_line": 4888,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CastTo",
                        "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)",
                        "filename": "arrayobject.c",
                        "nloc": 40,
                        "complexity": 10,
                        "token_count": 214,
                        "parameters": [
                            "out",
                            "mp"
                        ],
                        "start_line": 4895,
                        "end_line": 4941,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 47,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromarray",
                        "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 116,
                        "complexity": 35,
                        "token_count": 725,
                        "parameters": [
                            "arr",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 4944,
                        "end_line": 5075,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 132,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_array_typecode_fromstr",
                        "long_name": "_array_typecode_fromstr( char * str , int * swap , PyArray_Typecode * type)",
                        "filename": "arrayobject.c",
                        "nloc": 94,
                        "complexity": 36,
                        "token_count": 533,
                        "parameters": [
                            "str",
                            "swap",
                            "type"
                        ],
                        "start_line": 5079,
                        "end_line": 5184,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 106,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 83,
                        "complexity": 18,
                        "token_count": 543,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5187,
                        "end_line": 5282,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 96,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromattr",
                        "long_name": "array_fromattr( PyObject * op , PyArray_Typecode * typecode , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 21,
                        "complexity": 4,
                        "token_count": 120,
                        "parameters": [
                            "op",
                            "typecode",
                            "flags"
                        ],
                        "start_line": 5285,
                        "end_line": 5306,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 22,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_fromobject",
                        "long_name": "array_fromobject( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 46,
                        "complexity": 13,
                        "token_count": 270,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "flags"
                        ],
                        "start_line": 5310,
                        "end_line": 5372,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 63,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ArrayType",
                        "long_name": "PyArray_ArrayType( PyObject * op , PyArray_Typecode * intype , PyArray_Typecode * outtype)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 1,
                        "token_count": 29,
                        "parameters": [
                            "op",
                            "intype",
                            "outtype"
                        ],
                        "start_line": 5375,
                        "end_line": 5380,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ObjectType",
                        "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "op",
                            "minimum_type"
                        ],
                        "start_line": 5383,
                        "end_line": 5389,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromAny",
                        "long_name": "PyArray_FromAny( PyObject * op , PyArray_Typecode * typecode , int min_depth , int max_depth , int requires)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 9,
                        "token_count": 165,
                        "parameters": [
                            "op",
                            "typecode",
                            "min_depth",
                            "max_depth",
                            "requires"
                        ],
                        "start_line": 5443,
                        "end_line": 5473,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_EnsureArray",
                        "long_name": "PyArray_EnsureArray( PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 14,
                        "complexity": 5,
                        "token_count": 87,
                        "parameters": [
                            "op"
                        ],
                        "start_line": 5484,
                        "end_line": 5500,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_FromObject",
                        "long_name": "PyArray_FromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5506,
                        "end_line": 5512,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromObject",
                        "long_name": "PyArray_ContiguousFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5515,
                        "end_line": 5522,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CopyFromObject",
                        "long_name": "PyArray_CopyFromObject( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 51,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5525,
                        "end_line": 5532,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_ContiguousFromAny",
                        "long_name": "PyArray_ContiguousFromAny( PyObject * op , int type , int min_depth , int max_depth)",
                        "filename": "arrayobject.c",
                        "nloc": 8,
                        "complexity": 1,
                        "token_count": 49,
                        "parameters": [
                            "op",
                            "type",
                            "min_depth",
                            "max_depth"
                        ],
                        "start_line": 5537,
                        "end_line": 5544,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastSafely",
                        "long_name": "PyArray_CanCastSafely( int fromtype , int totype)",
                        "filename": "arrayobject.c",
                        "nloc": 81,
                        "complexity": 39,
                        "token_count": 476,
                        "parameters": [
                            "fromtype",
                            "totype"
                        ],
                        "start_line": 5547,
                        "end_line": 5630,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 84,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_CanCastTo",
                        "long_name": "PyArray_CanCastTo( PyArray_Typecode * from , PyArray_Typecode * to)",
                        "filename": "arrayobject.c",
                        "nloc": 24,
                        "complexity": 7,
                        "token_count": 134,
                        "parameters": [
                            "from",
                            "to"
                        ],
                        "start_line": 5633,
                        "end_line": 5657,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 25,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_IterNew",
                        "long_name": "PyArray_IterNew( PyObject * obj)",
                        "filename": "arrayobject.c",
                        "nloc": 34,
                        "complexity": 6,
                        "token_count": 258,
                        "parameters": [
                            "obj"
                        ],
                        "start_line": 5667,
                        "end_line": 5704,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 5709,
                        "end_line": 5719,
                        "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": 6,
                        "complexity": 1,
                        "token_count": 25,
                        "parameters": [
                            "it"
                        ],
                        "start_line": 5722,
                        "end_line": 5727,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arrayiter_traverse",
                        "long_name": "arrayiter_traverse( PyArrayIterObject * it , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "it",
                            "visit",
                            "arg"
                        ],
                        "start_line": 5730,
                        "end_line": 5735,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "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": 5739,
                        "end_line": 5742,
                        "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": 42,
                        "complexity": 7,
                        "token_count": 272,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5746,
                        "end_line": 5794,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript_int",
                        "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 51,
                        "complexity": 8,
                        "token_count": 347,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5797,
                        "end_line": 5850,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 54,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_subscript",
                        "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 20,
                        "token_count": 593,
                        "parameters": [
                            "self",
                            "ind"
                        ],
                        "start_line": 5854,
                        "end_line": 5973,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 120,
                        "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": 176,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 5977,
                        "end_line": 6009,
                        "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": 289,
                        "parameters": [
                            "self",
                            "ind",
                            "val",
                            "swap"
                        ],
                        "start_line": 6012,
                        "end_line": 6054,
                        "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": 103,
                        "complexity": 24,
                        "token_count": 636,
                        "parameters": [
                            "self",
                            "ind",
                            "val"
                        ],
                        "start_line": 6058,
                        "end_line": 6180,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 123,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "iter_array",
                        "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)",
                        "filename": "arrayobject.c",
                        "nloc": 30,
                        "complexity": 5,
                        "token_count": 221,
                        "parameters": [
                            "it",
                            "op"
                        ],
                        "start_line": 6193,
                        "end_line": 6235,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 43,
                        "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": 6240,
                        "end_line": 6244,
                        "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": 55,
                        "complexity": 22,
                        "token_count": 293,
                        "parameters": [
                            "args"
                        ],
                        "start_line": 6309,
                        "end_line": 6370,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 62,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_convert_obj",
                        "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)",
                        "filename": "arrayobject.c",
                        "nloc": 15,
                        "complexity": 5,
                        "token_count": 105,
                        "parameters": [
                            "obj",
                            "iter"
                        ],
                        "start_line": 6378,
                        "end_line": 6393,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "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": 6399,
                        "end_line": 6468,
                        "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": 261,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6472,
                        "end_line": 6509,
                        "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": 296,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6515,
                        "end_line": 6559,
                        "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": 102,
                        "complexity": 22,
                        "token_count": 690,
                        "parameters": [
                            "mit",
                            "arr"
                        ],
                        "start_line": 6577,
                        "end_line": 6713,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 137,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_nonzero_indices",
                        "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)",
                        "filename": "arrayobject.c",
                        "nloc": 57,
                        "complexity": 15,
                        "token_count": 454,
                        "parameters": [
                            "myBool",
                            "iters"
                        ],
                        "start_line": 6719,
                        "end_line": 6788,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "PyArray_MapIterNew",
                        "long_name": "PyArray_MapIterNew( PyObject * indexobj)",
                        "filename": "arrayobject.c",
                        "nloc": 111,
                        "complexity": 24,
                        "token_count": 745,
                        "parameters": [
                            "indexobj"
                        ],
                        "start_line": 6791,
                        "end_line": 6924,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 134,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_new",
                        "long_name": "arraymapiter_new( PyTypeObject * type , PyObject * args , PyObject * kwds)",
                        "filename": "arrayobject.c",
                        "nloc": 26,
                        "complexity": 5,
                        "token_count": 130,
                        "parameters": [
                            "type",
                            "args",
                            "kwds"
                        ],
                        "start_line": 6930,
                        "end_line": 6960,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 31,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_dealloc",
                        "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)",
                        "filename": "arrayobject.c",
                        "nloc": 10,
                        "complexity": 2,
                        "token_count": 60,
                        "parameters": [
                            "mit"
                        ],
                        "start_line": 6981,
                        "end_line": 6990,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "arraymapiter_traverse",
                        "long_name": "arraymapiter_traverse( PyArrayMapIterObject * mit , visitproc visit , * arg)",
                        "filename": "arrayobject.c",
                        "nloc": 16,
                        "complexity": 9,
                        "token_count": 146,
                        "parameters": [
                            "mit",
                            "visit",
                            "arg"
                        ],
                        "start_line": 6993,
                        "end_line": 7011,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 19,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "array_frominterface",
                        "long_name": "array_frominterface( PyObject * input , PyArray_Typecode * intype , int flags)",
                        "filename": "arrayobject.c",
                        "nloc": 97,
                        "complexity": 22,
                        "token_count": 619,
                        "parameters": [
                            "input",
                            "intype",
                            "flags"
                        ],
                        "start_line": 5193,
                        "end_line": 5301,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 109,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "array_dataptr_get",
                        "long_name": "array_dataptr_get( PyArrayObject * self)",
                        "filename": "arrayobject.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 18,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 3742,
                        "end_line": 3745,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 5563,
                "complexity": 1222,
                "token_count": 33297,
                "diff_parsed": {
                    "added": [
                        "static PyObject *",
                        "array_dataptr_get(PyArrayObject *self)",
                        "{",
                        "\treturn PyString_FromFormat(\"%p\", self->data);",
                        "}",
                        "",
                        "\t (getter)array_dataptr_get,",
                        "\tif (attr && !PyString_Check(attr)) {",
                        "\t\tPyErr_SetString(PyExc_TypeError, \"__array_data__ must return\"\\",
                        "\t\t\t\t\" a string providing the pointer to data.\");",
                        "\t\tPy_DECREF(attr);",
                        "\t\treturn NULL;",
                        "\t}",
                        "\tif ((attr == NULL) || (PyString_GET_SIZE(attr) < 1)) {",
                        "\t\tres = PyObject_AsWriteBuffer(input, (void **)&data,",
                        "\t\t\t\t\t     &buffer_len);",
                        "\t\tPy_XDECREF(attr);",
                        "\t\tif (res < 0) return NULL;",
                        "\t}",
                        "\telse {",
                        "\t\tres = sscanf(PyString_AsString(attr), \"%p\", (void **)&data);",
                        "\t\tPy_DECREF(attr);",
                        "\t\tif (res < 1) {",
                        "\t\t\tPyErr_SetString(PyExc_TypeError,",
                        "\t\t\t\t\t\"__array_data__ cannot be converted.\");",
                        "\t\t\treturn NULL;",
                        "\t\t}"
                    ],
                    "deleted": [
                        "\t (getter)array_data_get,",
                        "\tif (attr == NULL) {",
                        "\t\tPy_INCREF(input);",
                        "\t\tattr = input;",
                        "",
                        "\tres = PyObject_AsWriteBuffer(attr, (void **)&data, &buffer_len);",
                        "\tPy_DECREF(attr);",
                        "\tif (res < 0) return NULL;"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/scalartypes.inc.src",
                "new_path": "scipy/base/src/scalartypes.inc.src",
                "filename": "scalartypes.inc.src",
                "extension": "src",
                "change_type": "MODIFY",
                "diff": "@@ -545,6 +545,12 @@ gentype_shape_set(PyObject *self, PyObject *val)\n }\n */\n \n+static PyObject *\n+gentype_dataptr_get(PyObject *self)\n+{\n+\treturn PyString_FromString(\"\");\n+}\n+\n \n static PyObject *\n gentype_data_get(PyObject *self)\n@@ -768,7 +774,7 @@ static PyGetSetDef gentype_getsets[] = {\n \t (setter)0, \n \t \"a 1-d view of scalar\"}, \n \t{\"__array_data__\", \n-\t (getter)gentype_data_get,\n+\t (getter)gentype_dataptr_get,\n \t NULL,\n \t \"Array protocol: data\"},\n \t{\"__array_typestr__\",\n",
                "added_lines": 7,
                "deleted_lines": 1,
                "source_code": "/* -*- c -*- */\n\n/**begin repeat\n\n#name=Bool, Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, ULongLong, Float, Double, LongDouble,  CFloat, CDouble, CLongDouble, Object,#\n#type=Bool, signed char, short, int, long, longlong, unsigned char, unsigned short, unsigned int, unsigned long, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, PyObject *,char#\n*/\ntypedef struct {\n\tPyObject_HEAD;\n\t@type@ obval;\n} Py@name@ScalarObject;\n\n/**end repeat**/\n\n/* Inheritance established later when tp_bases is set (or tp_base for \n   single inheritance) */\n\n/**begin repeat\n\n#name=numeric, integer, signedinteger, unsignedinteger, inexact, floating, complexfloating, flexible, \ncharacter#\n#NAME=Numeric, Integer, SignedInteger, UnsignedInteger, Inexact, Floating, ComplexFloating, Flexible, Character#\n*/\n\nstatic PyTypeObject Py@NAME@ArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"@name@_arrtype\",\t\t          /*tp_name*/\n        sizeof(PyObject),\t\t          /*tp_basicsize*/\n};\n/**end repeat**/\n\n\n#define PyStringScalarObject PyStringObject\n#define PyUnicodeScalarObject PyUnicodeObject\n\ntypedef struct {\n\tPyObject_VAR_HEAD;\n\tchar *obval;\n} PyVoidScalarObject;\n\n/* 0-dim array from array-scalar object */\n\nstatic PyObject *\nPyArray_FromScalar(PyObject *scalar, PyArray_Typecode *outcode)\n{\n\tPyArray_Typecode typecode;\n\tPyObject *r;\n\tchar *memptr;\n\tPyObject *ret;\n\n\t/* convert to 0-dim array of scalar typecode */\n\tPyArray_TypecodeFromScalar(scalar, &typecode);\n\tr = PyArray_New(&PyArray_Type, 0, NULL, typecode.type_num,\n\t\t\tNULL, NULL, typecode.itemsize, 0, NULL);\n\tif (r==NULL) return NULL;\n\n\tswitch(typecode.type_num) {\n\tcase PyArray_STRING:\n\t\tmemptr = PyString_AS_STRING(scalar);\n\t\tbreak;\n\tcase PyArray_UNICODE:\n\t\tmemptr = (char *)PyUnicode_AS_DATA(scalar);\n\t\tbreak;\n\tcase PyArray_VOID:\n\t\tmemptr = (((PyVoidScalarObject *)scalar)->obval);\n\t\tbreak;\n\tdefault:\n\t\tmemptr = &(((PyScalarObject *)scalar)->obval);\n\t\tbreak;\n\t}\n\n\tmemcpy(PyArray_DATA(r), memptr, PyArray_ITEMSIZE(r));\n\tif (PyArray_ISOBJECT(r)) {\n\t\tPy_INCREF(*((PyObject **)memptr));\n\t}\n\t\n\tif (outcode == NULL || \\\n\t    outcode->type_num == PyArray_NOTYPE ||\t\\\n\t    outcode->type_num == PyArray_TYPE(r))\n\t\treturn r;\n\n\t/* cast if necessary to desired output typecode */\n\tret = PyArray_CastToType((PyArrayObject *)r, outcode);\n\tPy_DECREF(r);\n\treturn ret;\n}\n\n\nstatic void\ngentype_dealloc(PyObject *v) \n{\n\tv->ob_type->tp_free(v);\n}\n\n\nstatic PyObject *\ngentype_power(PyObject *m1, PyObject *m2, PyObject *m3)\n{\n\tPyObject *arr, *ret, *arg2;\n\tchar *msg=\"unsupported operand type(s) for ** or pow()\";\n\t\n\tif (!PyArray_IsScalar(m1,Generic)) {\n\t\tif (PyArray_Check(m1)) {\n\t\t\tret = m1->ob_type->tp_as_number->nb_power(m1,m2, \n\t\t\t\t\t\t\t\t  Py_None);\n\t\t}\n\t\telse {\n\t\t\tif (!PyArray_IsScalar(m2,Generic)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tarr = PyArray_FromScalar(m2, NULL);\n\t\t\tif (arr == NULL) return NULL;\n\t\t\tret = arr->ob_type->tp_as_number->nb_power(m1, arr,\n\t\t\t\t\t\t\t\t   Py_None);\n\t\t\tPy_DECREF(arr);\n\t\t}\n\t\treturn ret;\n\t}\n\tif (!PyArray_IsScalar(m2, Generic)) {\n\t\tif (PyArray_Check(m2)) {\n\t\t\tret = m2->ob_type->tp_as_number->nb_power(m1,m2, \n\t\t\t\t\t\t\t\t  Py_None);\n\t\t}\n\t\telse {\n\t\t\tif (!PyArray_IsScalar(m1, Generic)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tarr = PyArray_FromScalar(m1, NULL);\n\t\t\tif (arr == NULL) return NULL;\n\t\t\tret = arr->ob_type->tp_as_number->nb_power(arr, m2,\n\t\t\t\t\t\t\t\t   Py_None);\n\t\t\tPy_DECREF(arr);\n\t\t}\n\t\treturn ret;\n\t}\n\tarr=arg2=NULL;\n\tarr = PyArray_FromScalar(m1, NULL);\n\targ2 = PyArray_FromScalar(m2, NULL);\t\n\tif (arr == NULL || arg2 == NULL) {\n\t\tPy_XDECREF(arr); Py_XDECREF(arg2); return NULL;\n\t}\n\tret = arr->ob_type->tp_as_number->nb_power(arr, arg2, Py_None);\n\tPy_DECREF(arr);\n\tPy_DECREF(arg2);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_generic_method(PyObject *self, PyObject *args, PyObject *kwds, \n\t\t       char *str)\n{\n\tPyObject *arr, *meth, *ret;\n\n\tarr = PyArray_FromScalar(self, NULL);\n\tif (arr == NULL) return NULL;\n\tmeth = PyObject_GetAttrString(arr, str);\n\tif (kwds == NULL) \n\t\tret = PyObject_CallObject(meth, args);\n\telse\n\t\tret = PyObject_Call(meth, args, kwds);\n\tPy_DECREF(meth);\n\tPy_DECREF(arr);\n\treturn PyArray_Return((PyArrayObject *)ret);\n}\n\n/**begin repeat\n\n#name=add, subtract, divide, remainder, divmod, lshift, rshift, and, xor, or, floor_divide, true_divide#\n#PYNAME=Add, Subtract, Divide, Remainder, Divmod, Lshift, Rshift, And, Xor, Or, FloorDivide, TrueDivide#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *m1, PyObject *m2)\n{\n\tPyObject *arr, *ret=NULL, *tup;\n\t\n\tif (!PyArray_IsScalar(m1, Generic)) {\n\t\tif (PyArray_Check(m1)) {\n\t\t\tret = m1->ob_type->tp_as_number->nb_@name@(m1,m2);\n\t\t}\n                else {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array scalar and try again */\n\t\t\tnewarr = PyArray_FromAny(m1, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_@name@(newarr, m2);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret=NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\tif (!PyArray_IsScalar(m2, Generic)) {\n\t\tif (PyArray_Check(m2)) {\n\t\t\tret = m2->ob_type->tp_as_number->nb_@name@(m1,m2);\n\t\t}\n\t\telse {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array and try again */\n\t\t\tnewarr = PyArray_FromAny(m2, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_@name@(m1, newarr);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret=NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\tarr=tup=NULL;\n\tarr = PyArray_FromScalar(m1, NULL);\n\ttup = PyArray_FromScalar(m2, NULL);\n\tif (arr == NULL || tup == NULL) {\n\t\tPy_XDECREF(tup); Py_XDECREF(arr); return NULL;\n\t}\n\tret = arr->ob_type->tp_as_number->nb_@name@(arr, tup);\n\tPy_DECREF(arr);\n\tPy_DECREF(tup);\n\treturn ret;\n}\n/**end repeat**/\n\n\nstatic PyObject *\ngentype_multiply(PyObject *m1, PyObject *m2)\n{\n\tPyObject *arr, *ret=NULL, *tup;\n\tlong repeat;\n\n\tif (!PyArray_IsScalar(m1, Generic)) {\n\t\tif (PyArray_Check(m1)) {\n\t\t\tret = m1->ob_type->tp_as_number->nb_multiply(m1,m2);\n\t\t}\n\t\telse if ((m1->ob_type->tp_as_number == NULL) ||\n\t\t\t (m1->ob_type->tp_as_number->nb_multiply == NULL)) {\n\t\t\t/* Convert m2 to an int and assume sequence\n\t\t\t   repeat */\n\t\t\trepeat = PyInt_AsLong(m2);\n\t\t\tif (repeat == -1 && PyErr_Occurred()) return NULL;\n\t\t\tret = PySequence_Repeat(m1, (int) repeat);\n\t\t\tif (ret == NULL) {\n\t\t\t\tPyErr_Clear();\n\t\t\t\tarr = PyArray_FromScalar(m2, NULL);\n\t\t\t\tif (arr == NULL) return NULL;\n\t\t\t\tret = arr->ob_type->tp_as_number->\\\n\t\t\t\t\tnb_multiply(m1, arr);\n\t\t\t\tPy_DECREF(arr);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array scalar and try again */\n\t\t\tnewarr = PyArray_FromAny(m1, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_multiply(newarr, m2);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret=NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\tif (!PyArray_IsScalar(m2, Generic)) {\n\t\tif (PyArray_Check(m2)) {\n\t\t\tret = m2->ob_type->tp_as_number->nb_multiply(m1,m2);\n\t\t}\n\t\telse if ((m2->ob_type->tp_as_number == NULL) ||\n\t\t\t (m2->ob_type->tp_as_number->nb_multiply == NULL)) {\n\t\t\t/* Convert m1 to an int and assume sequence\n\t\t\t   repeat */\n\t\t\trepeat = PyInt_AsLong(m1);\n\t\t\tif (repeat == -1 && PyErr_Occurred()) return NULL;\n\t\t\tret = PySequence_Repeat(m2, (int) repeat);\n\t\t\tif (ret == NULL) {\n\t\t\t\tPyErr_Clear();\n\t\t\t\tarr = PyArray_FromScalar(m1, NULL);\n\t\t\t\tif (arr == NULL) return NULL;\n\t\t\t\tret = arr->ob_type->tp_as_number->\t\\\n\t\t\t\t\tnb_multiply(arr, m2);\n\t\t\t\tPy_DECREF(arr);\n\t\t\t}\t\t\t\n\t\t}\n\t\telse {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array scalar and try again */\n\t\t\tnewarr = PyArray_FromAny(m2, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_multiply(m1, newarr);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret =NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\t/* Both are array scalar objects */\n\tarr=tup=NULL;\n\tarr = PyArray_FromScalar(m1, NULL);\n\ttup = PyArray_FromScalar(m2, NULL);\n\tif (arr == NULL || tup == NULL) {\n\t\tPy_XDECREF(tup); Py_XDECREF(arr); return NULL;\n\t}\n\tret = arr->ob_type->tp_as_number->nb_multiply(arr, tup);\n\tPy_DECREF(arr);\n\tPy_DECREF(tup);\n\treturn ret;\n\n}\n\n\n\n/**begin repeat\n\n#name=negative, absolute, invert, int, long, float, oct, hex#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *m1)\n{\n\tPyObject *arr, *ret;\n\n\tarr = PyArray_FromScalar(m1, NULL);\n\tif (arr == NULL) return NULL;\n\tret = arr->ob_type->tp_as_number->nb_@name@(arr);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n/**end repeat**/\n\nstatic int\ngentype_nonzero_number(PyObject *m1)\n{\n\tPyObject *arr;\n\tint ret;\n\n\tarr = PyArray_FromScalar(m1, NULL);\n\tif (arr == NULL) return -1;\n\tret = arr->ob_type->tp_as_number->nb_nonzero(arr);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_str(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tif (arr==NULL) return NULL;\n\tret = PyObject_Str(arr->descr->getitem(arr->data, arr));\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_repr(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tif (arr==NULL) return NULL;\n\tret = PyObject_Repr(arr->descr->getitem(arr->data, arr));\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic void\nformat_longdouble(char *buf, size_t buflen, longdouble val, int precision)\n{\n        register char *cp;\n\n        PyOS_snprintf(buf, buflen, \"%.*\" LONGDOUBLE_FMT, precision, val);\n        cp = buf;\n        if (*cp == '-')\n                cp++;\n        for (; *cp != '\\0'; cp++) {\n                if (!isdigit(Py_CHARMASK(*cp)))\n                        break;\n        }\n        if (*cp == '\\0') {\n                *cp++ = '.';\n                *cp++ = '0';\n                *cp++ = '\\0';\n        }\n}\n\n#if SIZEOF_LONGDOUBLE == SIZEOF_DOUBLE\n#define PREC_REPR 15\n#define PREC_STR 15\n#else\n#define PREC_REPR 21\n#define PREC_STR 21\n#endif\n\nstatic PyObject *\nlongdoubletype_repr(PyObject *self)\n{\n        static char buf[100];\n        format_longdouble(buf, sizeof(buf), ((PyLongDoubleScalarObject *)self)->obval, PREC_REPR);\n        return PyString_FromString(buf);\n}\n\nstatic PyObject *\nclongdoubletype_repr(PyObject *self)\n{\n        static char buf1[100];\n        static char buf2[100];\n\tstatic char buf3[202];\n        clongdouble x;\n        x = ((PyCLongDoubleScalarObject *)self)->obval;\n        format_longdouble(buf1, sizeof(buf1), x.real, PREC_REPR);\n        format_longdouble(buf2, sizeof(buf2), x.imag, PREC_REPR);\n\n\tsnprintf(buf3, sizeof(buf3), \"(%s+%sj)\", buf1, buf2);\n\treturn PyString_FromString(buf3);\n}\n\n#define longdoubletype_str longdoubletype_repr\n#define clongdoubletype_str clongdoubletype_repr\n\n/** Could improve this with a PyLong_FromLongDouble(longdouble ldval)\n    but this would need some more work...\n**/\n\n/**begin repeat\n\n#name=(int, long, hex, oct, float)*2#\n#KIND=(Long*4, Float)*2#\n#char=,,,,,c*5#\n#CHAR=,,,,,C*5#\n#POST=,,,,,.real*5#\n*/\nstatic PyObject *\n@char@longdoubletype_@name@(PyObject *self)\n{\n\tdouble dval;\n\tPyObject *obj, *ret;\n\t\n\tdval = (double)(((Py@CHAR@LongDoubleScalarObject *)self)->obval)@POST@;\n\tobj = Py@KIND@_FromDouble(dval);\n\tret = obj->ob_type->tp_as_number->nb_@name@(obj);\n\tPy_DECREF(obj);\n\treturn ret;\n}\n/**end repeat**/\n\n\nstatic PyObject *gentype_copy(PyObject *, PyObject *);\n\nstatic PyNumberMethods gentype_as_number = {\n        (binaryfunc)gentype_add,\t\t    /*nb_add*/\n        (binaryfunc)gentype_subtract,\t\t    /*nb_subtract*/\n        (binaryfunc)gentype_multiply,\t\t    /*nb_multiply*/\n        (binaryfunc)gentype_divide,\t\t    /*nb_divide*/\n        (binaryfunc)gentype_remainder,\t    /*nb_remainder*/\n        (binaryfunc)gentype_divmod,\t\t    /*nb_divmod*/\n        (ternaryfunc)gentype_power,\t\t    /*nb_power*/\n        (unaryfunc)gentype_negative,\t            \n        (unaryfunc)gentype_copy,\t\t    /*nb_pos*/ \n        (unaryfunc)gentype_absolute,\t\t    /*(unaryfunc)gentype_abs,*/\n        (inquiry)gentype_nonzero_number,\t\t    /*nb_nonzero*/\n        (unaryfunc)gentype_invert,\t\t    /*nb_invert*/\n        (binaryfunc)gentype_lshift,\t    /*nb_lshift*/\n        (binaryfunc)gentype_rshift,\t    /*nb_rshift*/\n        (binaryfunc)gentype_and,\t    /*nb_and*/\n        (binaryfunc)gentype_xor,\t    /*nb_xor*/\n        (binaryfunc)gentype_or,\t    /*nb_or*/\n        0,\t\t                    /*nb_coerce*/\n        (unaryfunc)gentype_int,\t\t    /*nb_int*/\n        (unaryfunc)gentype_long,\t\t    /*nb_long*/\n        (unaryfunc)gentype_float,\t\t    /*nb_float*/\n        (unaryfunc)gentype_oct,\t\t    /*nb_oct*/\n        (unaryfunc)gentype_hex,\t\t    /*nb_hex*/\n        0,                               /*inplace_add*/\n        0,                              /*inplace_subtract*/\n        0,                              /*inplace_multiply*/\n        0,                              /*inplace_divide*/\n        0,                            /*inplace_remainder*/\n        0,                              /*inplace_power*/\n        0,                            /*inplace_lshift*/\n        0,                            /*inplace_rshift*/\n        0,                            /*inplace_and*/\n        0,                            /*inplace_xor*/\n        0,                            /*inplace_or*/\n        (binaryfunc)gentype_floor_divide,\t     /*nb_floor_divide*/\n        (binaryfunc)gentype_true_divide,\t     /*nb_true_divide*/\n        0,                                         /*nb_inplace_floor_divide*/\n        0,                                         /*nb_inplace_true_divide*/\n\n};\n\nstatic PyObject *\ngentype_richcompare(PyObject *self, PyObject *other, int cmp_op) \n{\n\n\tPyObject *arr, *ret;\n\n\tarr = PyArray_FromScalar(self, NULL);\n\tif (arr == NULL) return NULL;\n\tret = arr->ob_type->tp_richcompare(arr, other, cmp_op);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_ndim_get(PyObject *self)\n{\n\treturn PyInt_FromLong(0);\n}\n\nstatic PyObject *\ngentype_flags_get(PyObject *self)\n{\n\tstatic int flags=CONTIGUOUS | OWNDATA | FORTRAN | ALIGNED | \\\n\t\tNOTSWAPPED;\n        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, flags, 1);\n\n}\n\nstatic PyObject *\ngentype_shape_get(PyObject *self)\n{\n\treturn PyTuple_New(0);\n}\n\n/*\nstatic int\ngentype_shape_set(PyObject *self, PyObject *val)\n{\n\tif (!PyTuple_Check(val) || PyTuple_GET_SIZE(val) > 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \\\n\t\t\t\t\"invalid shape for scalar\");\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n*/\n\nstatic PyObject *\ngentype_dataptr_get(PyObject *self)\n{\n\treturn PyString_FromString(\"\");\n}\n\n\nstatic PyObject *\ngentype_data_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\n\treturn PyBuffer_FromObject(self, 0, typecode.itemsize);\n}\n\n\nstatic PyObject *\ngentype_itemsize_get(PyObject *self)\n{\t\n\tPyArray_Typecode typecode;\n\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\treturn PyInt_FromLong((long) typecode.itemsize);\n}\n\nstatic PyObject *\ngentype_size_get(PyObject *self)\n{\n\treturn PyInt_FromLong(1);\n}\n\n\nstatic PyObject *\ngentype_typechar_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\tPyArray_Descr *descr;\n\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\tdescr = PyArray_DescrFromType(typecode.type_num);\n\tif (PyArray_IsScalar(self, Flexible)) \n\t\treturn PyString_FromFormat(\"%c%d\", (int)(descr->type),\n\t\t\t\t\t   typecode.itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(descr->type), 1);\n}\n\nstatic PyObject *\ngentype_typestr_get(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tret = PyObject_GetAttrString((PyObject *)arr, \"dtypestr\");\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_descr_get(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tret = PyObject_GetAttrString((PyObject *)arr, \"__array_descr__\");\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\n\nstatic PyObject *\ngentype_typenum_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\treturn PyInt_FromLong((long) typecode.type_num);\n}\n\nstatic PyObject *\ngentype_type_get(PyObject *self)\n{\n\treturn (PyObject *)self->ob_type;\n}\n\n\nstatic PyObject *\ngentype_base_get(PyObject *self)\n{\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\n\nstatic PyObject *\ngentype_real_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\n\tif (PyArray_IsScalar(self, ComplexFloating)) {\n\t\tPyArray_TypecodeFromScalar(self, &typecode);\n\t\treturn PyArray_Scalar(&(((PyScalarObject *)self)->obval),\n\t\t\t\t      typecode.type_num-PyArray_NUM_FLOATTYPE,\n\t\t\t\t      typecode.itemsize >> 1, 0);\n\t}\n\telse if PyArray_IsScalar(self, Object) {\n\t\tPyObject *obj = ((PyObjectScalarObject *)self)->obval;\n\t\tPyObject *ret;\n\t\tret = PyObject_GetAttrString(obj, \"real\");\n\t\tif (ret != NULL) return ret;\n\t}\n\tPy_INCREF(self);\n\treturn (PyObject *)self;\n}\n\nstatic PyObject *\ngentype_imag_get(PyObject *self)\n{\t\n\tPyArray_Typecode typecode;\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\tif (PyArray_IsScalar(self, ComplexFloating)) {\n\t\ttypecode.itemsize >>= 1;\n\t\treturn PyArray_Scalar(&(((PyScalarObject *)self)->obval)\n\t\t\t\t      + typecode.itemsize, \n\t\t\t\t      typecode.type_num-PyArray_NUM_FLOATTYPE,\n\t\t\t\t      typecode.itemsize, 0);\n\t}\n\telse if PyArray_IsScalar(self, Object) {\n\t\tPyObject *obj = ((PyObjectScalarObject *)self)->obval;\n\t\tPyObject *ret;\n\t\tret = PyObject_GetAttrString(obj, \"imag\");\n\t\tif (ret == NULL) {\n\t\t\tPyErr_Clear();\n\t\t\tobj = PyInt_FromLong(0);\n\t\t\tret = PyArray_Scalar((char *)&obj, PyArray_OBJECT, \n\t\t\t\t\t     sizeof(void *), 0);\n\t\t\tPy_DECREF(obj);\n\t\t}\n\t\treturn ret;\n\t}\n\telse {\n\t\tPyObject *ret;\n\t\tchar *temp;\n\t\ttemp = PyDataMem_NEW(typecode.itemsize);\n\t\tmemset(temp, '\\0', typecode.itemsize);\n\t\tret = PyArray_Scalar(temp, typecode.type_num,\n\t\t\t\t     typecode.itemsize, 0);\n\t\tPyDataMem_FREE(temp);\n\t\treturn ret;\n\t}\n}\n\nstatic PyObject *\ngentype_flat_get(PyObject *self)\n{\n\tPyObject *ret, *arr;\n\n\tarr = PyArray_FromScalar(self, NULL);\n\tif (arr == NULL) return NULL;\n\tret = PyArray_IterNew(arr);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyGetSetDef gentype_getsets[] = {\n        {\"ndim\", \n\t (getter)gentype_ndim_get, \n\t (setter) 0, \n\t \"number of array dimensions\"},\n        {\"flags\", \n\t (getter)gentype_flags_get, \n\t (setter)0, \n\t \"integer value of flags\"},\n        {\"shape\", \n\t (getter)gentype_shape_get, \n\t (setter)0, \n\t \"tuple of array dimensions\"},\n        {\"strides\", \n\t (getter)gentype_shape_get, \n\t (setter) 0, \n\t \"tuple of bytes steps in each dimension\"},\n        {\"data\",\n\t (getter)gentype_data_get, \n\t (setter) 0, \n\t \"pointer to start of data\"},\n        {\"itemsize\", \n\t (getter)gentype_itemsize_get, \n\t (setter)0, \n\t \"length of one element in bytes\"},\n        {\"size\",\n         (getter)gentype_size_get,\n         (setter)0,\n         \"number of elements in the gentype\"},\n\t{\"base\",\n\t (getter)gentype_base_get,\n\t (setter)0,\n\t \"base object\"},\n        {\"dtype\", \n\t (getter)gentype_type_get, \n\t (setter)0, \n\t \"get gentype type class\"},\n\t{\"dtypechar\",\n\t (getter)gentype_typechar_get,\n\t (setter)0,\n\t \"get gentype type character code\"},\n\t{\"dtypenum\",\n\t (getter)gentype_typenum_get,\n\t (setter)0,\n\t \"get gentype type number code\"},\n\t{\"dtypestr\",\n\t (getter)gentype_typestr_get,\n\t NULL,\n\t \"get array type string\"},\n        {\"real\", \n\t (getter)gentype_real_get, \n\t (setter)0,\n\t \"real part of scalar\"},\n        {\"imag\", \n\t (getter)gentype_imag_get, \n\t (setter)0, \n\t \"imaginary part of scalar\"},\n\t{\"flat\", \n\t (getter)gentype_flat_get, \n\t (setter)0, \n\t \"a 1-d view of scalar\"}, \n\t{\"__array_data__\", \n\t (getter)gentype_dataptr_get,\n\t NULL,\n\t \"Array protocol: data\"},\n\t{\"__array_typestr__\",\n\t (getter)gentype_typestr_get,\n\t NULL,\n\t \"Array protocol: typestr\"},\n\t{\"__array_descr__\",\n\t (getter)gentype_descr_get,\n\t NULL,\n\t \"Array protocol: descr\"},\n\t{\"__array_shape__\", \n\t (getter)gentype_shape_get,\n\t NULL,\n\t \"Array protocol: shape\"},\n\t{\"__array_strides__\",\n\t (getter)gentype_shape_get,\n\t NULL,\n\t \"Array protocol: strides\"},\n\t/* Does not have __array_priority__ because it is not a subtype.\n\t */\n       \t{NULL, NULL, NULL, NULL}  /* Sentinel */\n};\n\n/* 0-dim array from scalar object */\n\nstatic char doc_getarray[] = \"sc.__array__(|type) return 0-dim array\";\n\nstatic PyObject *\ngentype_getarray(PyObject *scalar, PyObject *args) \n{\n\tPyArray_Typecode outcode = {PyArray_NOTYPE, 0, 0};\n\n\tif (!PyArg_ParseTuple(args, \"|O&\", &PyArray_TypecodeConverter,\n\t\t\t      &outcode)) return NULL;\n\treturn PyArray_FromScalar(scalar, &outcode);\n}\n\nstatic char doc_sc_wraparray[] = \"sc.__array_wrap__(obj) return scalar from array\";\n\nstatic PyObject *\ngentype_wraparray(PyObject *scalar, PyObject *args)\n{\n\tPyObject *arr;\n\n\tif (PyTuple_Size(args) < 1) {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"only accepts 1 argument.\");\n\t\treturn NULL;\n\t}\n\tarr = PyTuple_GET_ITEM(args, 0);\n\tif (!PyArray_Check(arr)) {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"can only be called with ndarray object\");\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_Scalar(PyArray_DATA(arr), PyArray_TYPE(arr),\n\t\t\t      PyArray_ITEMSIZE(arr), !PyArray_ISNOTSWAPPED(arr));\n}\n\n\n/**begin repeat\n\n#name=tolist, toscalar, tostring, astype, copy, resize, __deepcopy__, choose, sort, argsort, searchsorted, argmax, argmin, reshape, view, swapaxes, max, min, ptp, conj, conjugate, nonzero, all, any, flatten, ravel#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *self, PyObject *args)\n{\n\treturn gentype_generic_method(self, args, NULL, \"@name@\");\n}\n/**end repeat**/\n\nstatic PyObject *\ngentype_squeeze(PyObject *self, PyObject *args)\n{\n        if (!PyArg_ParseTuple(args, \"\")) return NULL;\n\tPy_INCREF(self);\n\treturn self;\n}\n\nstatic int\ngentype_getreadbuf(PyObject *, int, void **);\n\nstatic PyObject *\ngentype_byteswap(PyObject *self, PyObject *args)\n{\n\tBool inplace=FALSE;\n\t\n\tif (!PyArg_ParseTuple(args, \"|O&\", PyArray_BoolConverter, &inplace))\n\t\treturn NULL;\n\t\n\tif (inplace) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"cannot byteswap a scalar in-place\");\n\t\treturn NULL;\n\t}\n\telse {\n\t\t/* get the data, copyswap it and pass it to a new Array scalar\n\t\t */\n\t\tchar *data;\n\t\tint numbytes;\n\t\tPyArray_Typecode type;\n\t\tPyArray_Descr *descr;\n\t\tPyObject *new;\n\t\tchar *newmem;\n\n\t\tnumbytes = gentype_getreadbuf(self, 0, (void **)&data);\n\t\tPyArray_TypecodeFromScalar(self, &type);\n\t\tnewmem = malloc(type.itemsize);\n\t\tif (newmem == NULL) return PyErr_NoMemory();\n\t\telse memcpy(newmem, data, type.itemsize);\n\t\tdescr = PyArray_DescrFromType(type.type_num);\n\t\tdescr->copyswap(newmem, NULL, 1, type.itemsize);\t\t\n\t\tnew = PyArray_Scalar(newmem, type.type_num, type.itemsize, 0);\n\t\tfree(newmem);\n\t\treturn new;\n\t}\n}\n\n/**begin repeat\n\n#name=transpose, getfield, take, put, putmask, repeat, tofile, mean, trace, diagonal, clip, std, sum, cumsum, prod, cumprod, compress#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *self, PyObject *args, PyObject *kwds)\n{\n\treturn gentype_generic_method(self, args, kwds, \"@name@\");\n}\n/**end repeat**/\n\n\nstatic PyObject *\ngentype_reduce(PyObject *self, PyObject *args)\n{\n\tPyObject *ret=NULL, *obj=NULL, *mod=NULL;\n\tconst char *buffer; \n\tint buflen;\n\n\t/* Return a tuple of (callable object, arguments) */\n\n\tret = PyTuple_New(2);\n\tif (ret == NULL) return NULL;\t\n\tif (PyObject_AsReadBuffer(self, (const void **)&buffer, &buflen)<0) {\n\t\tPy_DECREF(ret); return NULL;\n\t}\n\tmod = PyImport_ImportModule(\"scipy.base.multiarray\");\n\tif (mod == NULL) return NULL;\n\tobj = PyObject_GetAttrString(mod, \"scalar\");\n\tPy_DECREF(mod);\n\tif (obj == NULL) return NULL;\n\tPyTuple_SET_ITEM(ret, 0, obj);\n\tobj = PyObject_GetAttrString((PyObject *)self, \"dtypestr\");\n\tif PyArray_IsScalar(self, Object) {\n\t\tmod = ((PyObjectScalarObject *)self)->obval;\n\t\tPyTuple_SET_ITEM(ret, 1,\n\t\t\t\t Py_BuildValue(\"NO\", obj, mod));\n\t}\n\telse {\n\t\tmod = PyString_FromStringAndSize(buffer, buflen);\n\t\tPyTuple_SET_ITEM(ret, 1, \n\t\t\t\t Py_BuildValue(\"NN\", obj, mod));\n\t}\n\treturn ret;\n}\n\n/* ignores everything */\nstatic PyObject *\ngentype_setstate(PyObject *self, PyObject *args)\n{\n\tPy_INCREF(Py_None);\n\treturn (Py_None);\n}\n\nstatic PyObject *\ngentype_dump(PyObject *self, PyObject *args)\n{\n\tPyObject *file=NULL;\n\tint ret;\n\n\tif (!PyArg_ParseTuple(args, \"O\", &file))\n\t\treturn NULL;\n\tret = PyArray_Dump(self, file, 2);\n\tif (ret < 0) return NULL;\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyObject *\ngentype_dumps(PyObject *self, PyObject *args)\n{\n\tif (!PyArg_ParseTuple(args, \"\"))\n\t\treturn NULL;\n\treturn PyArray_Dumps(self, 2);\n}\n\n\n/* setting flags cannot be done for scalars */\nstatic PyObject *\ngentype_setflags(PyObject *self, PyObject *args, PyObject *kwds)\n{\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic int _array_typecode_fromstr(char *, int *, PyArray_Typecode *);\n\n/* need to fill in doc-strings for these methods on import -- copy from \n   array docstrings \n*/\nstatic PyMethodDef gentype_methods[] = {\n        {\"tolist\",\t (PyCFunction)gentype_tolist,\t1, NULL},\n        {\"toscalar\", (PyCFunction)gentype_toscalar, METH_VARARGS, NULL},\n\t{\"tofile\", (PyCFunction)gentype_tofile, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"tostring\", (PyCFunction)gentype_tostring, METH_VARARGS, NULL},\n        {\"byteswap\",   (PyCFunction)gentype_byteswap,1, NULL},\n        {\"astype\", (PyCFunction)gentype_astype, 1, NULL},\n\t{\"getfield\", (PyCFunction)gentype_getfield, \n\t METH_VARARGS | METH_KEYWORDS, NULL},\n        {\"copy\", (PyCFunction)gentype_copy, 1, NULL},  \n        {\"resize\", (PyCFunction)gentype_resize, 1, NULL}, \n\n\t{\"__array__\", (PyCFunction)gentype_getarray, 1, doc_getarray},\n\t{\"__array_wrap__\", (PyCFunction)gentype_wraparray, 1, doc_sc_wraparray},\n\n     /* for the copy module */\n        {\"__copy__\", (PyCFunction)gentype_copy, 1, NULL},\n        {\"__deepcopy__\", (PyCFunction)gentype___deepcopy__, 1, NULL},\n\n\n        {\"__reduce__\", (PyCFunction) gentype_reduce, 1, NULL},\t\n\t/* For consistency does nothing */\n\t{\"__setstate__\", (PyCFunction) gentype_setstate, 1, NULL},\n\n\t{\"dumps\", (PyCFunction) gentype_dumps, 1, NULL},\n\t{\"dump\", (PyCFunction) gentype_dump, 1, NULL},\n\n\t/* Methods for array */\n\t{\"transpose\",\t(PyCFunction)gentype_transpose, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"take\",\t(PyCFunction)gentype_take, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"put\",\t(PyCFunction)gentype_put, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"putmask\",\t(PyCFunction)gentype_putmask, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"repeat\",\t(PyCFunction)gentype_repeat, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"choose\",\t(PyCFunction)gentype_choose, \n\t METH_VARARGS, NULL},\t\n\t{\"sort\",\t(PyCFunction)gentype_sort, \n\t METH_VARARGS, NULL},\n\t{\"argsort\",\t(PyCFunction)gentype_argsort, \n\t METH_VARARGS, NULL},\n\t{\"searchsorted\",  (PyCFunction)gentype_searchsorted, \n\t METH_VARARGS, NULL},\t\n\t{\"argmax\",\t(PyCFunction)gentype_argmax, \n\t METH_VARARGS, NULL},\n\t{\"argmin\",  (PyCFunction)gentype_argmin,\n\t METH_VARARGS, NULL},\n\t{\"reshape\",\t(PyCFunction)gentype_reshape, \n\t METH_VARARGS, NULL},\n\t{\"squeeze\",\t(PyCFunction)gentype_squeeze, \n\t METH_VARARGS, NULL},\n\t{\"view\",  (PyCFunction)gentype_view, \n\t METH_VARARGS, NULL},\n\t{\"swapaxes\", (PyCFunction)gentype_swapaxes,\n\t METH_VARARGS, NULL},\n\t{\"max\", (PyCFunction)gentype_max,\n\t METH_VARARGS, NULL},\n\t{\"min\", (PyCFunction)gentype_min,\n\t METH_VARARGS, NULL},\n\t{\"ptp\", (PyCFunction)gentype_ptp,\n\t METH_VARARGS, NULL},\n\t{\"mean\", (PyCFunction)gentype_mean,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"trace\", (PyCFunction)gentype_trace,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"diagonal\", (PyCFunction)gentype_diagonal,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"clip\", (PyCFunction)gentype_clip,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"conj\", (PyCFunction)gentype_conj,\n\t METH_VARARGS, NULL},\n\t{\"conjugate\", (PyCFunction)gentype_conjugate,\n\t METH_VARARGS, NULL},\n\t{\"nonzero\", (PyCFunction)gentype_nonzero,\n\t METH_VARARGS, NULL},\n\t{\"std\", (PyCFunction)gentype_std,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"sum\", (PyCFunction)gentype_sum,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"cumsum\", (PyCFunction)gentype_cumsum,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"prod\", (PyCFunction)gentype_prod,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"cumprod\", (PyCFunction)gentype_cumprod,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"all\", (PyCFunction)gentype_all,\n\t METH_VARARGS, NULL},\n\t{\"any\", (PyCFunction)gentype_any,\n\t METH_VARARGS, NULL},\n\t{\"compress\", (PyCFunction)gentype_compress,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"flatten\", (PyCFunction)gentype_flatten,\n\t METH_VARARGS, NULL},\n\t{\"ravel\", (PyCFunction)gentype_ravel,\n\t METH_VARARGS, NULL},\n\t{\"setflags\", (PyCFunction)gentype_setflags,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t/* add other methods!!! */\n        {NULL,\t\tNULL}\t\t/* sentinel */\n};\n\nstatic int\ngentype_getreadbuf(PyObject *self, int segment, void **ptrptr)\n{\n\tint numbytes;\n\tPyArray_Typecode outcode;\n\t\n\tif (segment != 0) {\n\t\tPyErr_SetString(PyExc_SystemError, \n\t\t\t\t\"Accessing non-existent array segment\");\n\t\treturn -1;\n\t}\n\n\tPyArray_TypecodeFromScalar(self, &outcode);\n\tnumbytes = outcode.itemsize;\n\tif PyArray_IsScalar(self, Flexible) {\n\t\tif PyArray_IsScalar(self, String)\n\t\t\t*ptrptr = PyString_AS_STRING(self);\n\t\telse if PyArray_IsScalar(self, Unicode)\n\t\t\t*ptrptr = (char *)PyUnicode_AS_DATA(self);\n\t\telse if PyArray_IsScalar(self, Void)\n\t\t\t*ptrptr = ((PyVoidScalarObject *)self)->obval;\n\t}\n\telse \n\t\t*ptrptr = (void *)&(((PyScalarObject *)self)->obval);\n\n\treturn numbytes;\n}\n\nstatic int\ngentype_getsegcount(PyObject *self, int *lenp)\n{\n\tPyArray_Typecode outcode;\n\n\tPyArray_TypecodeFromScalar(self, &outcode);\n\tif (lenp)\n\t\t*lenp = outcode.itemsize;\n\treturn 1;\n}\n\nstatic int\ngentype_getcharbuf(PyObject *self, int segment, const char **ptrptr)\n{\n\tif (PyArray_IsScalar(self, String) ||\t\\\n\t    PyArray_IsScalar(self, Unicode))\n\t\treturn gentype_getreadbuf(self, segment, (void **)ptrptr);\n\telse {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"Non-character array cannot be interpreted \"\\\n\t\t\t\t\"as character buffer.\");\n\t\treturn -1;\n\t}\n}\n\n\nstatic PyBufferProcs gentype_as_buffer = {\n        (getreadbufferproc)gentype_getreadbuf,    /*bf_getreadbuffer*/\n        (getwritebufferproc)0,                    /*bf_getwritebuffer*/\n        (getsegcountproc)gentype_getsegcount,\t  /*bf_getsegcount*/\n        (getcharbufferproc)gentype_getcharbuf,      /*bf_getcharbuffer*/\n};\n\n\n#define BASEFLAGS Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES\n#define LEAFFLAGS  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES\n\nstatic PyTypeObject PyGenericArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"generic_arrtype\",\t          /*tp_name*/\n        sizeof(PyObject),\t\t          /*tp_basicsize*/\n};\n\n/* works for VOID and UNICODE */\n\nstatic void\nflexible_dealloc(PyObject *v) \n{\n\tPyDataMem_FREE(((PyVoidScalarObject *)v)->obval);\n\tv->ob_type->tp_free(v);\n}\n\nstatic void\nstring_arrtype_dealloc(PyObject *v)\n{\n\tv->ob_type->tp_free(v);\n}\n\nstatic void\nobject_arrtype_dealloc(PyObject *v)\n{\n\tPy_DECREF(((PyObjectScalarObject *)v)->obval);\n\tv->ob_type->tp_free(v);\n}\n\n/* string and unicode inherit from Python Type first and so GET_ITEM is different to\n   get to the Python Type.\n */\n\n/**begin repeat \n#name=byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, object#\n#TYPE=BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, OBJECT#\n#num=1*16,0,0,1#\n*/\nstatic PyObject *\n@name@_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj=NULL;\n\tPyObject *arr;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\n\tif (type->tp_bases && (PyTuple_GET_SIZE(type->tp_bases)==2)) {\n\t\tPyTypeObject *sup;\n\t\tPyObject *ret;\n\t\t/* We are inheriting from a Python type as well so\n\t\t   give it first dibs on conversion */\n\t\tsup = (PyTypeObject *)PyTuple_GET_ITEM(type->tp_bases, @num@);\n\t\tret = sup->tp_new(type, args, kwds);\n\t\tif (ret) return ret;\n\t\tPyErr_Clear();\n\t\t/* now do default conversion */\n\t}\n\n\tif (!PyArg_ParseTuple(args, \"O\", &obj)) return NULL;\n\n\ttypecode.type_num = PyArray_@TYPE@;\n\tarr = PyArray_FromAny(obj, &typecode, 0, 0, FORCECAST);\n\treturn PyArray_Return((PyArrayObject *)arr);\n}\n/**end repeat**/\n\n/* bool->tp_new only returns Py_True or Py_False */\nstatic PyObject *\nbool_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj=NULL;\n\tPyObject *arr;\n\tPyArray_Typecode typecode = {PyArray_BOOL, 0, 0};\n\n\tif (!PyArg_ParseTuple(args, \"O\", &obj)) return NULL;\n\n\tarr = PyArray_FromAny(obj, &typecode, 0, 0, FORCECAST);\n\treturn PyArray_Return((PyArrayObject *)arr);\n}\n\nstatic PyObject *\nvoid_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj, *arr;\n\tulonglong memu=1;\n\tPyObject *new=NULL;\n\tPyArray_Typecode typecode = {PyArray_VOID, 0, 0};\n\tchar *destptr;\n\n\tif (!PyArg_ParseTuple(args, \"O\", &obj)) return NULL;\n\t/* For a VOID scalar first see if obj is an integer or long \n\t    and create new memory of that size (filled with 0) for the scalar\n\t*/\n\n\tif (PyLong_Check(obj) || PyInt_Check(obj) || \\\n\t    PyArray_IsScalar(obj, Integer) ||\n\t    (PyArray_Check(obj) && PyArray_NDIM(obj)==0 &&\t\\\n\t     PyArray_ISINTEGER(obj))) {\n\t\tnew = obj->ob_type->tp_as_number->nb_long(obj);\n\t}\n\tif (new && PyLong_Check(new)) {\n\t\tPyObject *ret;\n\t\tmemu = PyLong_AsUnsignedLongLong(new);\n\t\tPy_DECREF(new);\n\t\tif (PyErr_Occurred() || (memu > MAX_INT)) {\n\t\t\tPyErr_Clear();\n\t\t\tPyErr_Format(PyExc_OverflowError, \n\t\t\t\t     \"size must be smaller than %d\",\n\t\t\t\t     (int) MAX_INT);\n\t\t\treturn NULL;\n\t\t}\n\t\tdestptr = PyDataMem_NEW((int) memu);\n\t\tif (destptr == NULL) return PyErr_NoMemory();\n\t\tret = type->tp_alloc(type, 0);\n\t\tif (ret == NULL) {\n\t\t\tPyDataMem_FREE(destptr);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\t((PyVoidScalarObject *)ret)->obval = destptr;\n\t\t((PyVoidScalarObject *)ret)->ob_size = (int) memu;\n\t\tmemset(destptr, '\\0', (size_t) memu);\n\t\treturn ret;\n\t}\n\n\tarr = PyArray_FromAny(obj, &typecode, 0, 0, FORCECAST);\n\treturn PyArray_Return((PyArrayObject *)arr);\n}\n\n\n/****************  Define Hash functions ********************/\n\n/**begin repeat\n#lname=bool,ubyte,ushort#\n#name=Bool,UByte, UShort#\n */\nstatic long\n@lname@_arrtype_hash(PyObject *obj)\n{\n        return (long)(((Py@name@ScalarObject *)obj)->obval);\n}\n/**end repeat**/\n\n/**begin repeat\n#lname=byte,short,uint,ulong#\n#name=Byte,Short,UInt,ULong#\n */\nstatic long\n@lname@_arrtype_hash(PyObject *obj)\n{\n        long x = (long)(((Py@name@ScalarObject *)obj)->obval);\n        if (x == -1) x=-2;\n        return x;\n}\n/**end repeat**/\n\n#if SIZEOF_INT != SIZEOF_LONG\nstatic long\nint_arrtype_hash(PyObject *obj)\n{\n        long x = (long)(((PyIntScalarObject *)obj)->obval);\n        if (x == -1) x=-2;\n        return x;\n}\n#endif\n\n/**begin repeat\n#char=,u#\n#Char=,U#\n#ext=&& (x >= LONG_MIN),#\n*/\n#if SIZEOF_LONG != SIZEOF_LONGLONG\n/* we assume SIZEOF_LONGLONG=2*SIZEOF_LONG */\nstatic long\n@char@longlong_arrtype_hash(PyObject *obj)\n{\n        long y;\n        @char@longlong x = (((Py@Char@LongLongScalarObject *)obj)->obval);\n\n        if ((x <= LONG_MAX)@ext@) {\n                y = (long) x;\n        }\n        else {\n                union Mask {\n                        long hashvals[2];\n                        @char@longlong v;\n                } both;\n\n                both.v = x;\n                y = both.hashvals[0] + (1000003)*both.hashvals[1];\n        }\n        if (y == -1) y = -2;\n        return y;\n}\n#endif\n/**end repeat**/\n\n#if SIZEOF_LONG==SIZEOF_LONGLONG\nstatic long\nulonglong_arrtype_hash(PyObject *obj)\n{\n        long x = (long)(((PyULongLongScalarObject *)obj)->obval);\n        if (x == -1) x=-2;\n        return x;\n}\n#endif\n\n\n\n/* Wrong thing to do for longdouble, but....*/\n/**begin repeat\n#lname=float, longdouble#\n#name=Float, LongDouble#\n */\nstatic long\n@lname@_arrtype_hash(PyObject *obj)\n{\n        return _Py_HashDouble((double) ((Py@name@ScalarObject *)obj)->obval);\n}\n\n/* borrowed from complex_hash */\nstatic long\nc@lname@_arrtype_hash(PyObject *obj)\n{\n        long hashreal, hashimag, combined;\n        hashreal = _Py_HashDouble((double)                              \\\n                                  (((PyC@name@ScalarObject *)obj)->obval).real);\n\n        if (hashreal == -1) return -1;\n        hashimag = _Py_HashDouble((double)                              \\\n                                  (((PyC@name@ScalarObject *)obj)->obval).imag);\n        if (hashimag == -1) return -1;\n\n        combined = hashreal + 1000003 * hashimag;\n        if (combined == -1) combined = -2;\n        return combined;\n}\n/**end repeat**/\n\nstatic long\nobject_arrtype_hash(PyObject *obj)\n{\n        return PyObject_Hash(((PyObjectScalarObject *)obj)->obval);\n}\n\n/* just hash the pointer */\nstatic long\nvoid_arrtype_hash(PyObject *obj)\n{\n        return _Py_HashPointer((void *)(((PyVoidScalarObject *)obj)->obval));\n}\n\n/**begin repeat\n#name=bool, string, unicode, void, object#\n#NAME=Bool, String, Unicode, Void, Object#\n*/\nstatic PyTypeObject Py@NAME@ArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"@name@_arrtype\",\t                  /*tp_name*/\n        sizeof(Py@NAME@ScalarObject),\t          /*tp_basicsize*/\n};\n/**end repeat**/\n\n/**begin repeat\n#NAME=Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#\n#name=int*5, uint*5, float*3, complex*3#\n#CNAME=(CHAR, SHORT, INT, LONG, LONGLONG)*2, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#\n*/\nstatic PyTypeObject Py@NAME@ArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"@name@\" STRBITSOF_@CNAME@ \"_arrtype\",\t  /*tp_name*/\n        sizeof(Py@NAME@ScalarObject),\t          /*tp_basicsize*/\n};\n\n/**end repeat**/\n\n\n\n\nstatic PyNumberMethods longdoubletype_as_number;\nstatic PyNumberMethods clongdoubletype_as_number;\n\nstatic void \ninitialize_numeric_types(void)\n{\n\tPyGenericArrType_Type.tp_dealloc = (destructor)gentype_dealloc;\n\tPyGenericArrType_Type.tp_as_number = &gentype_as_number;\n\tPyGenericArrType_Type.tp_as_buffer = &gentype_as_buffer;\n\tPyGenericArrType_Type.tp_flags = BASEFLAGS;\n\tPyGenericArrType_Type.tp_methods = gentype_methods;\n\tPyGenericArrType_Type.tp_getset = gentype_getsets;\n\tPyGenericArrType_Type.tp_new = NULL;\n\tPyGenericArrType_Type.tp_free = PyObject_Del;\n\tPyGenericArrType_Type.tp_repr = gentype_repr;\n\tPyGenericArrType_Type.tp_str = gentype_str;\n\tPyGenericArrType_Type.tp_richcompare = gentype_richcompare;\n\n\t/**begin repeat\n#NAME=Numeric, Integer, SignedInteger, UnsignedInteger, Inexact, Floating, \nComplexFloating, Flexible, Character#\n\t*/\n        Py@NAME@ArrType_Type.tp_flags = BASEFLAGS;\n\t/**end repeat**/\n\n\t/**begin repeat\n#name=bool, byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, void, object#\n#NAME=Bool, Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, String, Unicode, Void, Object#\n\t*/\n\tPy@NAME@ArrType_Type.tp_flags = LEAFFLAGS;\n\tPy@NAME@ArrType_Type.tp_new = @name@_arrtype_new;\n\tPy@NAME@ArrType_Type.tp_richcompare = gentype_richcompare;\n\t/**end repeat**/\n\t/* Allow the Void type to be subclassed -- for adding new types */\n\tPyVoidArrType_Type.tp_flags = BASEFLAGS;\n\n        /**begin repeat\n#name=bool, byte, short, ubyte, ushort, uint, ulong, ulonglong, float, longdouble, cfloat, clongdouble, void, object#\n#NAME=Bool, Byte, Short, UByte, UShort, UInt, ULong, ULongLong, Float, LongDouble, CFloat, CLongDouble, Void, Object#\n        */\n        Py@NAME@ArrType_Type.tp_hash = @name@_arrtype_hash;\n        /**end repeat**/\n\n#if SIZEOF_INT != SIZEOF_LONG\n        /* We won't be inheriting from Python Int type. */\n        PyIntArrType_Type.tp_hash = int_arrtype_hash;\n#endif\n\n#if SIZEOF_LONG != SIZEOF_LONGLONG\n        /* We won't be inheriting from Python Int type. */\n        PyLongLongArrType_Type.tp_hash = longlong_arrtype_hash;\n#endif\n\n\t/* These need to be coded specially because getitem does not\n\t   return a normal Python type\n\t*/\n\tPyLongDoubleArrType_Type.tp_as_number = &longdoubletype_as_number;\n\tPyCLongDoubleArrType_Type.tp_as_number = &clongdoubletype_as_number;\n\n\t/**begin repeat\n#name=int, long, hex, oct, float, repr, str#\n#kind=tp_as_number->nb*5, tp*2#\n\t*/\n\tPyLongDoubleArrType_Type.@kind@_@name@ = longdoubletype_@name@;\n\tPyCLongDoubleArrType_Type.@kind@_@name@ = clongdoubletype_@name@;\n\t/**end repeat**/\n\n\tPyStringArrType_Type.tp_itemsize = sizeof(char);\n\tPyStringArrType_Type.tp_dealloc = string_arrtype_dealloc;\n\tPyFlexibleArrType_Type.tp_dealloc = flexible_dealloc;\n\tPyObjectArrType_Type.tp_dealloc = object_arrtype_dealloc;\n\n\tPyArrayIter_Type.tp_iter = PyObject_SelfIter;\n\tPyArrayMapIter_Type.tp_iter = PyObject_SelfIter;\n}\n\n\nstatic PyTypeObject *typeobjects[] = {\n\t&PyBoolArrType_Type,\n\t&PyByteArrType_Type,\n\t&PyUByteArrType_Type,\n\t&PyShortArrType_Type,\n\t&PyUShortArrType_Type,\n\t&PyIntArrType_Type,\n\t&PyUIntArrType_Type,\n\t&PyLongArrType_Type,\n\t&PyULongArrType_Type,\n\t&PyLongLongArrType_Type,\n\t&PyULongLongArrType_Type,\n\t&PyFloatArrType_Type,\n\t&PyDoubleArrType_Type,\n\t&PyLongDoubleArrType_Type,\n\t&PyCFloatArrType_Type,\n\t&PyCDoubleArrType_Type,\n\t&PyCLongDoubleArrType_Type,\n\t&PyObjectArrType_Type,\n\t&PyStringArrType_Type,\n\t&PyUnicodeArrType_Type,\n\t&PyVoidArrType_Type\n};\n\n\nstatic int\nPyArray_TypenumFromTypeObject(PyObject *type) \n{\n\tint typenum, i;\n\n\ttypenum = PyArray_NOTYPE;\n        i = 0;\n\twhile(i < PyArray_NTYPES) {\n\t\tif (type == (PyObject *)typeobjects[i]) {\n\t\t\ttypenum = i;\n\t\t\tbreak;\n\t\t}\n                i++;\n\t}\n\tif (typenum != PyArray_NOTYPE)\n\t\treturn typenum;\n\n\t/* Find registered types */\n\t\n\t/* here */\n\n\t/* Convert generic types to specific types */\n\tif ((type == (PyObject *) &PyNumericArrType_Type) || \\\n\t    (type == (PyObject *) &PyInexactArrType_Type) || \\\n\t    (type == (PyObject *) &PyFloatingArrType_Type))\n\t\treturn PyArray_DOUBLE;\n\telse if (type == (PyObject *)&PyComplexFloatingArrType_Type)\n\t\treturn PyArray_CDOUBLE;\n\telse if ((type == (PyObject *)&PyIntegerArrType_Type) ||\t\\\n\t\t (type == (PyObject *)&PySignedIntegerArrType_Type))\n\t\treturn PyArray_LONG;\n\telse if (type == (PyObject *) &PyUnsignedIntegerArrType_Type)\n\t\treturn PyArray_ULONG;\n        else if (type == (PyObject *) &PyCharacterArrType_Type)\n\t\treturn PyArray_STRING;\n\telse if (type == (PyObject *) &PyFlexibleArrType_Type)\n\t\treturn PyArray_VOID;\n\telse if (type == (PyObject *)&PyBool_Type)\n\t\ttypenum = PyArray_BOOL;\n\telse if (type == (PyObject *)&PyInt_Type)\n\t\ttypenum = PyArray_LONG;\n\telse if (type == (PyObject *)&PyFloat_Type)\n\t\ttypenum = PyArray_DOUBLE;\t\n\telse if (type == (PyObject *)&PyComplex_Type)\n\t\ttypenum = PyArray_CDOUBLE;\n\telse if (type == (PyObject *)&PyString_Type)\n\t\ttypenum = PyArray_STRING;\n\telse if (type == (PyObject *)&PyUnicode_Type)\n\t\ttypenum = PyArray_UNICODE;\n\telse if (type == (PyObject *)&PyBuffer_Type)\n\t\ttypenum = PyArray_VOID;\n\telse\n\t\ttypenum = PyArray_OBJECT;\n\treturn typenum;\n}\n\nstatic void \nPyArray_TypecodeFromTypeObject(PyObject *type, PyArray_Typecode *typecode) {\n\tint itemsize = 0;\n\tint type_num;\n\n\ttype_num = PyArray_TypenumFromTypeObject(type);\n\ttypecode->type_num = type_num;\n\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n                itemsize = 0;\n\t}\n\telse {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type_num);\n\t\tif (descr != NULL)\n\t\t\titemsize = descr->elsize;\n\t}\n\ttypecode->itemsize = itemsize;\n\treturn;\n}\n\nstatic void \nPyArray_TypecodeFromScalar(PyObject *sc, PyArray_Typecode *typecode)\n{\n\tint type_num;\n\n        PyArray_TypecodeFromTypeObject((PyObject *)sc->ob_type, typecode);\n        if (typecode->itemsize == 0) {\n                type_num = typecode->type_num;\n\t\tif (type_num == PyArray_STRING) \n\t\t\ttypecode->itemsize = PyString_GET_SIZE(sc);\n\t\telse if (type_num == PyArray_UNICODE)\n\t\t\ttypecode->itemsize = PyUnicode_GET_DATA_SIZE(sc);\n\t\telse if (type_num == PyArray_VOID) {\n\t\t\ttypecode->itemsize = \\\n\t\t\t\t((PyVoidScalarObject *)sc)->ob_size;\n\t\t}\n        }\n\treturn;\n}\n\nstatic PyObject *\nPyArray_TypeObjectFromType(int type)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr == NULL) return NULL;\n\tPy_INCREF((PyObject *)descr->typeobj);\n\treturn (PyObject *)descr->typeobj;\n}\n\n",
                "source_code_before": "/* -*- c -*- */\n\n/**begin repeat\n\n#name=Bool, Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, ULongLong, Float, Double, LongDouble,  CFloat, CDouble, CLongDouble, Object,#\n#type=Bool, signed char, short, int, long, longlong, unsigned char, unsigned short, unsigned int, unsigned long, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, PyObject *,char#\n*/\ntypedef struct {\n\tPyObject_HEAD;\n\t@type@ obval;\n} Py@name@ScalarObject;\n\n/**end repeat**/\n\n/* Inheritance established later when tp_bases is set (or tp_base for \n   single inheritance) */\n\n/**begin repeat\n\n#name=numeric, integer, signedinteger, unsignedinteger, inexact, floating, complexfloating, flexible, \ncharacter#\n#NAME=Numeric, Integer, SignedInteger, UnsignedInteger, Inexact, Floating, ComplexFloating, Flexible, Character#\n*/\n\nstatic PyTypeObject Py@NAME@ArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"@name@_arrtype\",\t\t          /*tp_name*/\n        sizeof(PyObject),\t\t          /*tp_basicsize*/\n};\n/**end repeat**/\n\n\n#define PyStringScalarObject PyStringObject\n#define PyUnicodeScalarObject PyUnicodeObject\n\ntypedef struct {\n\tPyObject_VAR_HEAD;\n\tchar *obval;\n} PyVoidScalarObject;\n\n/* 0-dim array from array-scalar object */\n\nstatic PyObject *\nPyArray_FromScalar(PyObject *scalar, PyArray_Typecode *outcode)\n{\n\tPyArray_Typecode typecode;\n\tPyObject *r;\n\tchar *memptr;\n\tPyObject *ret;\n\n\t/* convert to 0-dim array of scalar typecode */\n\tPyArray_TypecodeFromScalar(scalar, &typecode);\n\tr = PyArray_New(&PyArray_Type, 0, NULL, typecode.type_num,\n\t\t\tNULL, NULL, typecode.itemsize, 0, NULL);\n\tif (r==NULL) return NULL;\n\n\tswitch(typecode.type_num) {\n\tcase PyArray_STRING:\n\t\tmemptr = PyString_AS_STRING(scalar);\n\t\tbreak;\n\tcase PyArray_UNICODE:\n\t\tmemptr = (char *)PyUnicode_AS_DATA(scalar);\n\t\tbreak;\n\tcase PyArray_VOID:\n\t\tmemptr = (((PyVoidScalarObject *)scalar)->obval);\n\t\tbreak;\n\tdefault:\n\t\tmemptr = &(((PyScalarObject *)scalar)->obval);\n\t\tbreak;\n\t}\n\n\tmemcpy(PyArray_DATA(r), memptr, PyArray_ITEMSIZE(r));\n\tif (PyArray_ISOBJECT(r)) {\n\t\tPy_INCREF(*((PyObject **)memptr));\n\t}\n\t\n\tif (outcode == NULL || \\\n\t    outcode->type_num == PyArray_NOTYPE ||\t\\\n\t    outcode->type_num == PyArray_TYPE(r))\n\t\treturn r;\n\n\t/* cast if necessary to desired output typecode */\n\tret = PyArray_CastToType((PyArrayObject *)r, outcode);\n\tPy_DECREF(r);\n\treturn ret;\n}\n\n\nstatic void\ngentype_dealloc(PyObject *v) \n{\n\tv->ob_type->tp_free(v);\n}\n\n\nstatic PyObject *\ngentype_power(PyObject *m1, PyObject *m2, PyObject *m3)\n{\n\tPyObject *arr, *ret, *arg2;\n\tchar *msg=\"unsupported operand type(s) for ** or pow()\";\n\t\n\tif (!PyArray_IsScalar(m1,Generic)) {\n\t\tif (PyArray_Check(m1)) {\n\t\t\tret = m1->ob_type->tp_as_number->nb_power(m1,m2, \n\t\t\t\t\t\t\t\t  Py_None);\n\t\t}\n\t\telse {\n\t\t\tif (!PyArray_IsScalar(m2,Generic)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tarr = PyArray_FromScalar(m2, NULL);\n\t\t\tif (arr == NULL) return NULL;\n\t\t\tret = arr->ob_type->tp_as_number->nb_power(m1, arr,\n\t\t\t\t\t\t\t\t   Py_None);\n\t\t\tPy_DECREF(arr);\n\t\t}\n\t\treturn ret;\n\t}\n\tif (!PyArray_IsScalar(m2, Generic)) {\n\t\tif (PyArray_Check(m2)) {\n\t\t\tret = m2->ob_type->tp_as_number->nb_power(m1,m2, \n\t\t\t\t\t\t\t\t  Py_None);\n\t\t}\n\t\telse {\n\t\t\tif (!PyArray_IsScalar(m1, Generic)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tarr = PyArray_FromScalar(m1, NULL);\n\t\t\tif (arr == NULL) return NULL;\n\t\t\tret = arr->ob_type->tp_as_number->nb_power(arr, m2,\n\t\t\t\t\t\t\t\t   Py_None);\n\t\t\tPy_DECREF(arr);\n\t\t}\n\t\treturn ret;\n\t}\n\tarr=arg2=NULL;\n\tarr = PyArray_FromScalar(m1, NULL);\n\targ2 = PyArray_FromScalar(m2, NULL);\t\n\tif (arr == NULL || arg2 == NULL) {\n\t\tPy_XDECREF(arr); Py_XDECREF(arg2); return NULL;\n\t}\n\tret = arr->ob_type->tp_as_number->nb_power(arr, arg2, Py_None);\n\tPy_DECREF(arr);\n\tPy_DECREF(arg2);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_generic_method(PyObject *self, PyObject *args, PyObject *kwds, \n\t\t       char *str)\n{\n\tPyObject *arr, *meth, *ret;\n\n\tarr = PyArray_FromScalar(self, NULL);\n\tif (arr == NULL) return NULL;\n\tmeth = PyObject_GetAttrString(arr, str);\n\tif (kwds == NULL) \n\t\tret = PyObject_CallObject(meth, args);\n\telse\n\t\tret = PyObject_Call(meth, args, kwds);\n\tPy_DECREF(meth);\n\tPy_DECREF(arr);\n\treturn PyArray_Return((PyArrayObject *)ret);\n}\n\n/**begin repeat\n\n#name=add, subtract, divide, remainder, divmod, lshift, rshift, and, xor, or, floor_divide, true_divide#\n#PYNAME=Add, Subtract, Divide, Remainder, Divmod, Lshift, Rshift, And, Xor, Or, FloorDivide, TrueDivide#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *m1, PyObject *m2)\n{\n\tPyObject *arr, *ret=NULL, *tup;\n\t\n\tif (!PyArray_IsScalar(m1, Generic)) {\n\t\tif (PyArray_Check(m1)) {\n\t\t\tret = m1->ob_type->tp_as_number->nb_@name@(m1,m2);\n\t\t}\n                else {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array scalar and try again */\n\t\t\tnewarr = PyArray_FromAny(m1, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_@name@(newarr, m2);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret=NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\tif (!PyArray_IsScalar(m2, Generic)) {\n\t\tif (PyArray_Check(m2)) {\n\t\t\tret = m2->ob_type->tp_as_number->nb_@name@(m1,m2);\n\t\t}\n\t\telse {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array and try again */\n\t\t\tnewarr = PyArray_FromAny(m2, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_@name@(m1, newarr);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret=NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\tarr=tup=NULL;\n\tarr = PyArray_FromScalar(m1, NULL);\n\ttup = PyArray_FromScalar(m2, NULL);\n\tif (arr == NULL || tup == NULL) {\n\t\tPy_XDECREF(tup); Py_XDECREF(arr); return NULL;\n\t}\n\tret = arr->ob_type->tp_as_number->nb_@name@(arr, tup);\n\tPy_DECREF(arr);\n\tPy_DECREF(tup);\n\treturn ret;\n}\n/**end repeat**/\n\n\nstatic PyObject *\ngentype_multiply(PyObject *m1, PyObject *m2)\n{\n\tPyObject *arr, *ret=NULL, *tup;\n\tlong repeat;\n\n\tif (!PyArray_IsScalar(m1, Generic)) {\n\t\tif (PyArray_Check(m1)) {\n\t\t\tret = m1->ob_type->tp_as_number->nb_multiply(m1,m2);\n\t\t}\n\t\telse if ((m1->ob_type->tp_as_number == NULL) ||\n\t\t\t (m1->ob_type->tp_as_number->nb_multiply == NULL)) {\n\t\t\t/* Convert m2 to an int and assume sequence\n\t\t\t   repeat */\n\t\t\trepeat = PyInt_AsLong(m2);\n\t\t\tif (repeat == -1 && PyErr_Occurred()) return NULL;\n\t\t\tret = PySequence_Repeat(m1, (int) repeat);\n\t\t\tif (ret == NULL) {\n\t\t\t\tPyErr_Clear();\n\t\t\t\tarr = PyArray_FromScalar(m2, NULL);\n\t\t\t\tif (arr == NULL) return NULL;\n\t\t\t\tret = arr->ob_type->tp_as_number->\\\n\t\t\t\t\tnb_multiply(m1, arr);\n\t\t\t\tPy_DECREF(arr);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array scalar and try again */\n\t\t\tnewarr = PyArray_FromAny(m1, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_multiply(newarr, m2);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret=NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\tif (!PyArray_IsScalar(m2, Generic)) {\n\t\tif (PyArray_Check(m2)) {\n\t\t\tret = m2->ob_type->tp_as_number->nb_multiply(m1,m2);\n\t\t}\n\t\telse if ((m2->ob_type->tp_as_number == NULL) ||\n\t\t\t (m2->ob_type->tp_as_number->nb_multiply == NULL)) {\n\t\t\t/* Convert m1 to an int and assume sequence\n\t\t\t   repeat */\n\t\t\trepeat = PyInt_AsLong(m1);\n\t\t\tif (repeat == -1 && PyErr_Occurred()) return NULL;\n\t\t\tret = PySequence_Repeat(m2, (int) repeat);\n\t\t\tif (ret == NULL) {\n\t\t\t\tPyErr_Clear();\n\t\t\t\tarr = PyArray_FromScalar(m1, NULL);\n\t\t\t\tif (arr == NULL) return NULL;\n\t\t\t\tret = arr->ob_type->tp_as_number->\t\\\n\t\t\t\t\tnb_multiply(arr, m2);\n\t\t\t\tPy_DECREF(arr);\n\t\t\t}\t\t\t\n\t\t}\n\t\telse {\n\t\t\tPyObject *newarr;\n\t\t\t/* Convert object to Array scalar and try again */\n\t\t\tnewarr = PyArray_FromAny(m2, NULL, 0, 0, 0);\n\t\t\tif (newarr!=NULL) {\n\t\t\t\tret = newarr->ob_type->tp_as_number->nb_multiply(m1, newarr);\n\t\t\t\tPy_DECREF(newarr);\n\t\t\t}\n\t\t\telse ret =NULL;\n\t\t}\n\t\treturn ret;\n\t}\n\t/* Both are array scalar objects */\n\tarr=tup=NULL;\n\tarr = PyArray_FromScalar(m1, NULL);\n\ttup = PyArray_FromScalar(m2, NULL);\n\tif (arr == NULL || tup == NULL) {\n\t\tPy_XDECREF(tup); Py_XDECREF(arr); return NULL;\n\t}\n\tret = arr->ob_type->tp_as_number->nb_multiply(arr, tup);\n\tPy_DECREF(arr);\n\tPy_DECREF(tup);\n\treturn ret;\n\n}\n\n\n\n/**begin repeat\n\n#name=negative, absolute, invert, int, long, float, oct, hex#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *m1)\n{\n\tPyObject *arr, *ret;\n\n\tarr = PyArray_FromScalar(m1, NULL);\n\tif (arr == NULL) return NULL;\n\tret = arr->ob_type->tp_as_number->nb_@name@(arr);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n/**end repeat**/\n\nstatic int\ngentype_nonzero_number(PyObject *m1)\n{\n\tPyObject *arr;\n\tint ret;\n\n\tarr = PyArray_FromScalar(m1, NULL);\n\tif (arr == NULL) return -1;\n\tret = arr->ob_type->tp_as_number->nb_nonzero(arr);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_str(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tif (arr==NULL) return NULL;\n\tret = PyObject_Str(arr->descr->getitem(arr->data, arr));\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_repr(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tif (arr==NULL) return NULL;\n\tret = PyObject_Repr(arr->descr->getitem(arr->data, arr));\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic void\nformat_longdouble(char *buf, size_t buflen, longdouble val, int precision)\n{\n        register char *cp;\n\n        PyOS_snprintf(buf, buflen, \"%.*\" LONGDOUBLE_FMT, precision, val);\n        cp = buf;\n        if (*cp == '-')\n                cp++;\n        for (; *cp != '\\0'; cp++) {\n                if (!isdigit(Py_CHARMASK(*cp)))\n                        break;\n        }\n        if (*cp == '\\0') {\n                *cp++ = '.';\n                *cp++ = '0';\n                *cp++ = '\\0';\n        }\n}\n\n#if SIZEOF_LONGDOUBLE == SIZEOF_DOUBLE\n#define PREC_REPR 15\n#define PREC_STR 15\n#else\n#define PREC_REPR 21\n#define PREC_STR 21\n#endif\n\nstatic PyObject *\nlongdoubletype_repr(PyObject *self)\n{\n        static char buf[100];\n        format_longdouble(buf, sizeof(buf), ((PyLongDoubleScalarObject *)self)->obval, PREC_REPR);\n        return PyString_FromString(buf);\n}\n\nstatic PyObject *\nclongdoubletype_repr(PyObject *self)\n{\n        static char buf1[100];\n        static char buf2[100];\n\tstatic char buf3[202];\n        clongdouble x;\n        x = ((PyCLongDoubleScalarObject *)self)->obval;\n        format_longdouble(buf1, sizeof(buf1), x.real, PREC_REPR);\n        format_longdouble(buf2, sizeof(buf2), x.imag, PREC_REPR);\n\n\tsnprintf(buf3, sizeof(buf3), \"(%s+%sj)\", buf1, buf2);\n\treturn PyString_FromString(buf3);\n}\n\n#define longdoubletype_str longdoubletype_repr\n#define clongdoubletype_str clongdoubletype_repr\n\n/** Could improve this with a PyLong_FromLongDouble(longdouble ldval)\n    but this would need some more work...\n**/\n\n/**begin repeat\n\n#name=(int, long, hex, oct, float)*2#\n#KIND=(Long*4, Float)*2#\n#char=,,,,,c*5#\n#CHAR=,,,,,C*5#\n#POST=,,,,,.real*5#\n*/\nstatic PyObject *\n@char@longdoubletype_@name@(PyObject *self)\n{\n\tdouble dval;\n\tPyObject *obj, *ret;\n\t\n\tdval = (double)(((Py@CHAR@LongDoubleScalarObject *)self)->obval)@POST@;\n\tobj = Py@KIND@_FromDouble(dval);\n\tret = obj->ob_type->tp_as_number->nb_@name@(obj);\n\tPy_DECREF(obj);\n\treturn ret;\n}\n/**end repeat**/\n\n\nstatic PyObject *gentype_copy(PyObject *, PyObject *);\n\nstatic PyNumberMethods gentype_as_number = {\n        (binaryfunc)gentype_add,\t\t    /*nb_add*/\n        (binaryfunc)gentype_subtract,\t\t    /*nb_subtract*/\n        (binaryfunc)gentype_multiply,\t\t    /*nb_multiply*/\n        (binaryfunc)gentype_divide,\t\t    /*nb_divide*/\n        (binaryfunc)gentype_remainder,\t    /*nb_remainder*/\n        (binaryfunc)gentype_divmod,\t\t    /*nb_divmod*/\n        (ternaryfunc)gentype_power,\t\t    /*nb_power*/\n        (unaryfunc)gentype_negative,\t            \n        (unaryfunc)gentype_copy,\t\t    /*nb_pos*/ \n        (unaryfunc)gentype_absolute,\t\t    /*(unaryfunc)gentype_abs,*/\n        (inquiry)gentype_nonzero_number,\t\t    /*nb_nonzero*/\n        (unaryfunc)gentype_invert,\t\t    /*nb_invert*/\n        (binaryfunc)gentype_lshift,\t    /*nb_lshift*/\n        (binaryfunc)gentype_rshift,\t    /*nb_rshift*/\n        (binaryfunc)gentype_and,\t    /*nb_and*/\n        (binaryfunc)gentype_xor,\t    /*nb_xor*/\n        (binaryfunc)gentype_or,\t    /*nb_or*/\n        0,\t\t                    /*nb_coerce*/\n        (unaryfunc)gentype_int,\t\t    /*nb_int*/\n        (unaryfunc)gentype_long,\t\t    /*nb_long*/\n        (unaryfunc)gentype_float,\t\t    /*nb_float*/\n        (unaryfunc)gentype_oct,\t\t    /*nb_oct*/\n        (unaryfunc)gentype_hex,\t\t    /*nb_hex*/\n        0,                               /*inplace_add*/\n        0,                              /*inplace_subtract*/\n        0,                              /*inplace_multiply*/\n        0,                              /*inplace_divide*/\n        0,                            /*inplace_remainder*/\n        0,                              /*inplace_power*/\n        0,                            /*inplace_lshift*/\n        0,                            /*inplace_rshift*/\n        0,                            /*inplace_and*/\n        0,                            /*inplace_xor*/\n        0,                            /*inplace_or*/\n        (binaryfunc)gentype_floor_divide,\t     /*nb_floor_divide*/\n        (binaryfunc)gentype_true_divide,\t     /*nb_true_divide*/\n        0,                                         /*nb_inplace_floor_divide*/\n        0,                                         /*nb_inplace_true_divide*/\n\n};\n\nstatic PyObject *\ngentype_richcompare(PyObject *self, PyObject *other, int cmp_op) \n{\n\n\tPyObject *arr, *ret;\n\n\tarr = PyArray_FromScalar(self, NULL);\n\tif (arr == NULL) return NULL;\n\tret = arr->ob_type->tp_richcompare(arr, other, cmp_op);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_ndim_get(PyObject *self)\n{\n\treturn PyInt_FromLong(0);\n}\n\nstatic PyObject *\ngentype_flags_get(PyObject *self)\n{\n\tstatic int flags=CONTIGUOUS | OWNDATA | FORTRAN | ALIGNED | \\\n\t\tNOTSWAPPED;\n        static PyObject *module=NULL;\n\n        if (module==NULL) {\n                module = PyImport_ImportModule(\"scipy.base._internal\");\n                if (module == NULL) return NULL;\n        }\n        return PyObject_CallMethod(module, \"flagsobj\", \"Oii\", \n                                   self, flags, 1);\n\n}\n\nstatic PyObject *\ngentype_shape_get(PyObject *self)\n{\n\treturn PyTuple_New(0);\n}\n\n/*\nstatic int\ngentype_shape_set(PyObject *self, PyObject *val)\n{\n\tif (!PyTuple_Check(val) || PyTuple_GET_SIZE(val) > 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \\\n\t\t\t\t\"invalid shape for scalar\");\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n*/\n\n\nstatic PyObject *\ngentype_data_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\n\treturn PyBuffer_FromObject(self, 0, typecode.itemsize);\n}\n\n\nstatic PyObject *\ngentype_itemsize_get(PyObject *self)\n{\t\n\tPyArray_Typecode typecode;\n\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\treturn PyInt_FromLong((long) typecode.itemsize);\n}\n\nstatic PyObject *\ngentype_size_get(PyObject *self)\n{\n\treturn PyInt_FromLong(1);\n}\n\n\nstatic PyObject *\ngentype_typechar_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\tPyArray_Descr *descr;\n\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\tdescr = PyArray_DescrFromType(typecode.type_num);\n\tif (PyArray_IsScalar(self, Flexible)) \n\t\treturn PyString_FromFormat(\"%c%d\", (int)(descr->type),\n\t\t\t\t\t   typecode.itemsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(descr->type), 1);\n}\n\nstatic PyObject *\ngentype_typestr_get(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tret = PyObject_GetAttrString((PyObject *)arr, \"dtypestr\");\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyObject *\ngentype_descr_get(PyObject *self)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tarr = (PyArrayObject *)PyArray_FromScalar(self, NULL);\n\tret = PyObject_GetAttrString((PyObject *)arr, \"__array_descr__\");\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\n\nstatic PyObject *\ngentype_typenum_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\treturn PyInt_FromLong((long) typecode.type_num);\n}\n\nstatic PyObject *\ngentype_type_get(PyObject *self)\n{\n\treturn (PyObject *)self->ob_type;\n}\n\n\nstatic PyObject *\ngentype_base_get(PyObject *self)\n{\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\n\nstatic PyObject *\ngentype_real_get(PyObject *self)\n{\n\tPyArray_Typecode typecode;\n\n\tif (PyArray_IsScalar(self, ComplexFloating)) {\n\t\tPyArray_TypecodeFromScalar(self, &typecode);\n\t\treturn PyArray_Scalar(&(((PyScalarObject *)self)->obval),\n\t\t\t\t      typecode.type_num-PyArray_NUM_FLOATTYPE,\n\t\t\t\t      typecode.itemsize >> 1, 0);\n\t}\n\telse if PyArray_IsScalar(self, Object) {\n\t\tPyObject *obj = ((PyObjectScalarObject *)self)->obval;\n\t\tPyObject *ret;\n\t\tret = PyObject_GetAttrString(obj, \"real\");\n\t\tif (ret != NULL) return ret;\n\t}\n\tPy_INCREF(self);\n\treturn (PyObject *)self;\n}\n\nstatic PyObject *\ngentype_imag_get(PyObject *self)\n{\t\n\tPyArray_Typecode typecode;\n\tPyArray_TypecodeFromScalar(self, &typecode);\n\tif (PyArray_IsScalar(self, ComplexFloating)) {\n\t\ttypecode.itemsize >>= 1;\n\t\treturn PyArray_Scalar(&(((PyScalarObject *)self)->obval)\n\t\t\t\t      + typecode.itemsize, \n\t\t\t\t      typecode.type_num-PyArray_NUM_FLOATTYPE,\n\t\t\t\t      typecode.itemsize, 0);\n\t}\n\telse if PyArray_IsScalar(self, Object) {\n\t\tPyObject *obj = ((PyObjectScalarObject *)self)->obval;\n\t\tPyObject *ret;\n\t\tret = PyObject_GetAttrString(obj, \"imag\");\n\t\tif (ret == NULL) {\n\t\t\tPyErr_Clear();\n\t\t\tobj = PyInt_FromLong(0);\n\t\t\tret = PyArray_Scalar((char *)&obj, PyArray_OBJECT, \n\t\t\t\t\t     sizeof(void *), 0);\n\t\t\tPy_DECREF(obj);\n\t\t}\n\t\treturn ret;\n\t}\n\telse {\n\t\tPyObject *ret;\n\t\tchar *temp;\n\t\ttemp = PyDataMem_NEW(typecode.itemsize);\n\t\tmemset(temp, '\\0', typecode.itemsize);\n\t\tret = PyArray_Scalar(temp, typecode.type_num,\n\t\t\t\t     typecode.itemsize, 0);\n\t\tPyDataMem_FREE(temp);\n\t\treturn ret;\n\t}\n}\n\nstatic PyObject *\ngentype_flat_get(PyObject *self)\n{\n\tPyObject *ret, *arr;\n\n\tarr = PyArray_FromScalar(self, NULL);\n\tif (arr == NULL) return NULL;\n\tret = PyArray_IterNew(arr);\n\tPy_DECREF(arr);\n\treturn ret;\n}\n\nstatic PyGetSetDef gentype_getsets[] = {\n        {\"ndim\", \n\t (getter)gentype_ndim_get, \n\t (setter) 0, \n\t \"number of array dimensions\"},\n        {\"flags\", \n\t (getter)gentype_flags_get, \n\t (setter)0, \n\t \"integer value of flags\"},\n        {\"shape\", \n\t (getter)gentype_shape_get, \n\t (setter)0, \n\t \"tuple of array dimensions\"},\n        {\"strides\", \n\t (getter)gentype_shape_get, \n\t (setter) 0, \n\t \"tuple of bytes steps in each dimension\"},\n        {\"data\",\n\t (getter)gentype_data_get, \n\t (setter) 0, \n\t \"pointer to start of data\"},\n        {\"itemsize\", \n\t (getter)gentype_itemsize_get, \n\t (setter)0, \n\t \"length of one element in bytes\"},\n        {\"size\",\n         (getter)gentype_size_get,\n         (setter)0,\n         \"number of elements in the gentype\"},\n\t{\"base\",\n\t (getter)gentype_base_get,\n\t (setter)0,\n\t \"base object\"},\n        {\"dtype\", \n\t (getter)gentype_type_get, \n\t (setter)0, \n\t \"get gentype type class\"},\n\t{\"dtypechar\",\n\t (getter)gentype_typechar_get,\n\t (setter)0,\n\t \"get gentype type character code\"},\n\t{\"dtypenum\",\n\t (getter)gentype_typenum_get,\n\t (setter)0,\n\t \"get gentype type number code\"},\n\t{\"dtypestr\",\n\t (getter)gentype_typestr_get,\n\t NULL,\n\t \"get array type string\"},\n        {\"real\", \n\t (getter)gentype_real_get, \n\t (setter)0,\n\t \"real part of scalar\"},\n        {\"imag\", \n\t (getter)gentype_imag_get, \n\t (setter)0, \n\t \"imaginary part of scalar\"},\n\t{\"flat\", \n\t (getter)gentype_flat_get, \n\t (setter)0, \n\t \"a 1-d view of scalar\"}, \n\t{\"__array_data__\", \n\t (getter)gentype_data_get,\n\t NULL,\n\t \"Array protocol: data\"},\n\t{\"__array_typestr__\",\n\t (getter)gentype_typestr_get,\n\t NULL,\n\t \"Array protocol: typestr\"},\n\t{\"__array_descr__\",\n\t (getter)gentype_descr_get,\n\t NULL,\n\t \"Array protocol: descr\"},\n\t{\"__array_shape__\", \n\t (getter)gentype_shape_get,\n\t NULL,\n\t \"Array protocol: shape\"},\n\t{\"__array_strides__\",\n\t (getter)gentype_shape_get,\n\t NULL,\n\t \"Array protocol: strides\"},\n\t/* Does not have __array_priority__ because it is not a subtype.\n\t */\n       \t{NULL, NULL, NULL, NULL}  /* Sentinel */\n};\n\n/* 0-dim array from scalar object */\n\nstatic char doc_getarray[] = \"sc.__array__(|type) return 0-dim array\";\n\nstatic PyObject *\ngentype_getarray(PyObject *scalar, PyObject *args) \n{\n\tPyArray_Typecode outcode = {PyArray_NOTYPE, 0, 0};\n\n\tif (!PyArg_ParseTuple(args, \"|O&\", &PyArray_TypecodeConverter,\n\t\t\t      &outcode)) return NULL;\n\treturn PyArray_FromScalar(scalar, &outcode);\n}\n\nstatic char doc_sc_wraparray[] = \"sc.__array_wrap__(obj) return scalar from array\";\n\nstatic PyObject *\ngentype_wraparray(PyObject *scalar, PyObject *args)\n{\n\tPyObject *arr;\n\n\tif (PyTuple_Size(args) < 1) {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"only accepts 1 argument.\");\n\t\treturn NULL;\n\t}\n\tarr = PyTuple_GET_ITEM(args, 0);\n\tif (!PyArray_Check(arr)) {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"can only be called with ndarray object\");\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_Scalar(PyArray_DATA(arr), PyArray_TYPE(arr),\n\t\t\t      PyArray_ITEMSIZE(arr), !PyArray_ISNOTSWAPPED(arr));\n}\n\n\n/**begin repeat\n\n#name=tolist, toscalar, tostring, astype, copy, resize, __deepcopy__, choose, sort, argsort, searchsorted, argmax, argmin, reshape, view, swapaxes, max, min, ptp, conj, conjugate, nonzero, all, any, flatten, ravel#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *self, PyObject *args)\n{\n\treturn gentype_generic_method(self, args, NULL, \"@name@\");\n}\n/**end repeat**/\n\nstatic PyObject *\ngentype_squeeze(PyObject *self, PyObject *args)\n{\n        if (!PyArg_ParseTuple(args, \"\")) return NULL;\n\tPy_INCREF(self);\n\treturn self;\n}\n\nstatic int\ngentype_getreadbuf(PyObject *, int, void **);\n\nstatic PyObject *\ngentype_byteswap(PyObject *self, PyObject *args)\n{\n\tBool inplace=FALSE;\n\t\n\tif (!PyArg_ParseTuple(args, \"|O&\", PyArray_BoolConverter, &inplace))\n\t\treturn NULL;\n\t\n\tif (inplace) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"cannot byteswap a scalar in-place\");\n\t\treturn NULL;\n\t}\n\telse {\n\t\t/* get the data, copyswap it and pass it to a new Array scalar\n\t\t */\n\t\tchar *data;\n\t\tint numbytes;\n\t\tPyArray_Typecode type;\n\t\tPyArray_Descr *descr;\n\t\tPyObject *new;\n\t\tchar *newmem;\n\n\t\tnumbytes = gentype_getreadbuf(self, 0, (void **)&data);\n\t\tPyArray_TypecodeFromScalar(self, &type);\n\t\tnewmem = malloc(type.itemsize);\n\t\tif (newmem == NULL) return PyErr_NoMemory();\n\t\telse memcpy(newmem, data, type.itemsize);\n\t\tdescr = PyArray_DescrFromType(type.type_num);\n\t\tdescr->copyswap(newmem, NULL, 1, type.itemsize);\t\t\n\t\tnew = PyArray_Scalar(newmem, type.type_num, type.itemsize, 0);\n\t\tfree(newmem);\n\t\treturn new;\n\t}\n}\n\n/**begin repeat\n\n#name=transpose, getfield, take, put, putmask, repeat, tofile, mean, trace, diagonal, clip, std, sum, cumsum, prod, cumprod, compress#\n*/\n\nstatic PyObject *\ngentype_@name@(PyObject *self, PyObject *args, PyObject *kwds)\n{\n\treturn gentype_generic_method(self, args, kwds, \"@name@\");\n}\n/**end repeat**/\n\n\nstatic PyObject *\ngentype_reduce(PyObject *self, PyObject *args)\n{\n\tPyObject *ret=NULL, *obj=NULL, *mod=NULL;\n\tconst char *buffer; \n\tint buflen;\n\n\t/* Return a tuple of (callable object, arguments) */\n\n\tret = PyTuple_New(2);\n\tif (ret == NULL) return NULL;\t\n\tif (PyObject_AsReadBuffer(self, (const void **)&buffer, &buflen)<0) {\n\t\tPy_DECREF(ret); return NULL;\n\t}\n\tmod = PyImport_ImportModule(\"scipy.base.multiarray\");\n\tif (mod == NULL) return NULL;\n\tobj = PyObject_GetAttrString(mod, \"scalar\");\n\tPy_DECREF(mod);\n\tif (obj == NULL) return NULL;\n\tPyTuple_SET_ITEM(ret, 0, obj);\n\tobj = PyObject_GetAttrString((PyObject *)self, \"dtypestr\");\n\tif PyArray_IsScalar(self, Object) {\n\t\tmod = ((PyObjectScalarObject *)self)->obval;\n\t\tPyTuple_SET_ITEM(ret, 1,\n\t\t\t\t Py_BuildValue(\"NO\", obj, mod));\n\t}\n\telse {\n\t\tmod = PyString_FromStringAndSize(buffer, buflen);\n\t\tPyTuple_SET_ITEM(ret, 1, \n\t\t\t\t Py_BuildValue(\"NN\", obj, mod));\n\t}\n\treturn ret;\n}\n\n/* ignores everything */\nstatic PyObject *\ngentype_setstate(PyObject *self, PyObject *args)\n{\n\tPy_INCREF(Py_None);\n\treturn (Py_None);\n}\n\nstatic PyObject *\ngentype_dump(PyObject *self, PyObject *args)\n{\n\tPyObject *file=NULL;\n\tint ret;\n\n\tif (!PyArg_ParseTuple(args, \"O\", &file))\n\t\treturn NULL;\n\tret = PyArray_Dump(self, file, 2);\n\tif (ret < 0) return NULL;\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyObject *\ngentype_dumps(PyObject *self, PyObject *args)\n{\n\tif (!PyArg_ParseTuple(args, \"\"))\n\t\treturn NULL;\n\treturn PyArray_Dumps(self, 2);\n}\n\n\n/* setting flags cannot be done for scalars */\nstatic PyObject *\ngentype_setflags(PyObject *self, PyObject *args, PyObject *kwds)\n{\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic int _array_typecode_fromstr(char *, int *, PyArray_Typecode *);\n\n/* need to fill in doc-strings for these methods on import -- copy from \n   array docstrings \n*/\nstatic PyMethodDef gentype_methods[] = {\n        {\"tolist\",\t (PyCFunction)gentype_tolist,\t1, NULL},\n        {\"toscalar\", (PyCFunction)gentype_toscalar, METH_VARARGS, NULL},\n\t{\"tofile\", (PyCFunction)gentype_tofile, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"tostring\", (PyCFunction)gentype_tostring, METH_VARARGS, NULL},\n        {\"byteswap\",   (PyCFunction)gentype_byteswap,1, NULL},\n        {\"astype\", (PyCFunction)gentype_astype, 1, NULL},\n\t{\"getfield\", (PyCFunction)gentype_getfield, \n\t METH_VARARGS | METH_KEYWORDS, NULL},\n        {\"copy\", (PyCFunction)gentype_copy, 1, NULL},  \n        {\"resize\", (PyCFunction)gentype_resize, 1, NULL}, \n\n\t{\"__array__\", (PyCFunction)gentype_getarray, 1, doc_getarray},\n\t{\"__array_wrap__\", (PyCFunction)gentype_wraparray, 1, doc_sc_wraparray},\n\n     /* for the copy module */\n        {\"__copy__\", (PyCFunction)gentype_copy, 1, NULL},\n        {\"__deepcopy__\", (PyCFunction)gentype___deepcopy__, 1, NULL},\n\n\n        {\"__reduce__\", (PyCFunction) gentype_reduce, 1, NULL},\t\n\t/* For consistency does nothing */\n\t{\"__setstate__\", (PyCFunction) gentype_setstate, 1, NULL},\n\n\t{\"dumps\", (PyCFunction) gentype_dumps, 1, NULL},\n\t{\"dump\", (PyCFunction) gentype_dump, 1, NULL},\n\n\t/* Methods for array */\n\t{\"transpose\",\t(PyCFunction)gentype_transpose, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"take\",\t(PyCFunction)gentype_take, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"put\",\t(PyCFunction)gentype_put, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"putmask\",\t(PyCFunction)gentype_putmask, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"repeat\",\t(PyCFunction)gentype_repeat, \n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"choose\",\t(PyCFunction)gentype_choose, \n\t METH_VARARGS, NULL},\t\n\t{\"sort\",\t(PyCFunction)gentype_sort, \n\t METH_VARARGS, NULL},\n\t{\"argsort\",\t(PyCFunction)gentype_argsort, \n\t METH_VARARGS, NULL},\n\t{\"searchsorted\",  (PyCFunction)gentype_searchsorted, \n\t METH_VARARGS, NULL},\t\n\t{\"argmax\",\t(PyCFunction)gentype_argmax, \n\t METH_VARARGS, NULL},\n\t{\"argmin\",  (PyCFunction)gentype_argmin,\n\t METH_VARARGS, NULL},\n\t{\"reshape\",\t(PyCFunction)gentype_reshape, \n\t METH_VARARGS, NULL},\n\t{\"squeeze\",\t(PyCFunction)gentype_squeeze, \n\t METH_VARARGS, NULL},\n\t{\"view\",  (PyCFunction)gentype_view, \n\t METH_VARARGS, NULL},\n\t{\"swapaxes\", (PyCFunction)gentype_swapaxes,\n\t METH_VARARGS, NULL},\n\t{\"max\", (PyCFunction)gentype_max,\n\t METH_VARARGS, NULL},\n\t{\"min\", (PyCFunction)gentype_min,\n\t METH_VARARGS, NULL},\n\t{\"ptp\", (PyCFunction)gentype_ptp,\n\t METH_VARARGS, NULL},\n\t{\"mean\", (PyCFunction)gentype_mean,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"trace\", (PyCFunction)gentype_trace,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"diagonal\", (PyCFunction)gentype_diagonal,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"clip\", (PyCFunction)gentype_clip,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"conj\", (PyCFunction)gentype_conj,\n\t METH_VARARGS, NULL},\n\t{\"conjugate\", (PyCFunction)gentype_conjugate,\n\t METH_VARARGS, NULL},\n\t{\"nonzero\", (PyCFunction)gentype_nonzero,\n\t METH_VARARGS, NULL},\n\t{\"std\", (PyCFunction)gentype_std,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"sum\", (PyCFunction)gentype_sum,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"cumsum\", (PyCFunction)gentype_cumsum,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"prod\", (PyCFunction)gentype_prod,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"cumprod\", (PyCFunction)gentype_cumprod,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"all\", (PyCFunction)gentype_all,\n\t METH_VARARGS, NULL},\n\t{\"any\", (PyCFunction)gentype_any,\n\t METH_VARARGS, NULL},\n\t{\"compress\", (PyCFunction)gentype_compress,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t{\"flatten\", (PyCFunction)gentype_flatten,\n\t METH_VARARGS, NULL},\n\t{\"ravel\", (PyCFunction)gentype_ravel,\n\t METH_VARARGS, NULL},\n\t{\"setflags\", (PyCFunction)gentype_setflags,\n\t METH_VARARGS|METH_KEYWORDS, NULL},\n\t/* add other methods!!! */\n        {NULL,\t\tNULL}\t\t/* sentinel */\n};\n\nstatic int\ngentype_getreadbuf(PyObject *self, int segment, void **ptrptr)\n{\n\tint numbytes;\n\tPyArray_Typecode outcode;\n\t\n\tif (segment != 0) {\n\t\tPyErr_SetString(PyExc_SystemError, \n\t\t\t\t\"Accessing non-existent array segment\");\n\t\treturn -1;\n\t}\n\n\tPyArray_TypecodeFromScalar(self, &outcode);\n\tnumbytes = outcode.itemsize;\n\tif PyArray_IsScalar(self, Flexible) {\n\t\tif PyArray_IsScalar(self, String)\n\t\t\t*ptrptr = PyString_AS_STRING(self);\n\t\telse if PyArray_IsScalar(self, Unicode)\n\t\t\t*ptrptr = (char *)PyUnicode_AS_DATA(self);\n\t\telse if PyArray_IsScalar(self, Void)\n\t\t\t*ptrptr = ((PyVoidScalarObject *)self)->obval;\n\t}\n\telse \n\t\t*ptrptr = (void *)&(((PyScalarObject *)self)->obval);\n\n\treturn numbytes;\n}\n\nstatic int\ngentype_getsegcount(PyObject *self, int *lenp)\n{\n\tPyArray_Typecode outcode;\n\n\tPyArray_TypecodeFromScalar(self, &outcode);\n\tif (lenp)\n\t\t*lenp = outcode.itemsize;\n\treturn 1;\n}\n\nstatic int\ngentype_getcharbuf(PyObject *self, int segment, const char **ptrptr)\n{\n\tif (PyArray_IsScalar(self, String) ||\t\\\n\t    PyArray_IsScalar(self, Unicode))\n\t\treturn gentype_getreadbuf(self, segment, (void **)ptrptr);\n\telse {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"Non-character array cannot be interpreted \"\\\n\t\t\t\t\"as character buffer.\");\n\t\treturn -1;\n\t}\n}\n\n\nstatic PyBufferProcs gentype_as_buffer = {\n        (getreadbufferproc)gentype_getreadbuf,    /*bf_getreadbuffer*/\n        (getwritebufferproc)0,                    /*bf_getwritebuffer*/\n        (getsegcountproc)gentype_getsegcount,\t  /*bf_getsegcount*/\n        (getcharbufferproc)gentype_getcharbuf,      /*bf_getcharbuffer*/\n};\n\n\n#define BASEFLAGS Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES\n#define LEAFFLAGS  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES\n\nstatic PyTypeObject PyGenericArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"generic_arrtype\",\t          /*tp_name*/\n        sizeof(PyObject),\t\t          /*tp_basicsize*/\n};\n\n/* works for VOID and UNICODE */\n\nstatic void\nflexible_dealloc(PyObject *v) \n{\n\tPyDataMem_FREE(((PyVoidScalarObject *)v)->obval);\n\tv->ob_type->tp_free(v);\n}\n\nstatic void\nstring_arrtype_dealloc(PyObject *v)\n{\n\tv->ob_type->tp_free(v);\n}\n\nstatic void\nobject_arrtype_dealloc(PyObject *v)\n{\n\tPy_DECREF(((PyObjectScalarObject *)v)->obval);\n\tv->ob_type->tp_free(v);\n}\n\n/* string and unicode inherit from Python Type first and so GET_ITEM is different to\n   get to the Python Type.\n */\n\n/**begin repeat \n#name=byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, object#\n#TYPE=BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, OBJECT#\n#num=1*16,0,0,1#\n*/\nstatic PyObject *\n@name@_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj=NULL;\n\tPyObject *arr;\n\tPyArray_Typecode typecode = {PyArray_NOTYPE, 0, 0};\n\n\tif (type->tp_bases && (PyTuple_GET_SIZE(type->tp_bases)==2)) {\n\t\tPyTypeObject *sup;\n\t\tPyObject *ret;\n\t\t/* We are inheriting from a Python type as well so\n\t\t   give it first dibs on conversion */\n\t\tsup = (PyTypeObject *)PyTuple_GET_ITEM(type->tp_bases, @num@);\n\t\tret = sup->tp_new(type, args, kwds);\n\t\tif (ret) return ret;\n\t\tPyErr_Clear();\n\t\t/* now do default conversion */\n\t}\n\n\tif (!PyArg_ParseTuple(args, \"O\", &obj)) return NULL;\n\n\ttypecode.type_num = PyArray_@TYPE@;\n\tarr = PyArray_FromAny(obj, &typecode, 0, 0, FORCECAST);\n\treturn PyArray_Return((PyArrayObject *)arr);\n}\n/**end repeat**/\n\n/* bool->tp_new only returns Py_True or Py_False */\nstatic PyObject *\nbool_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj=NULL;\n\tPyObject *arr;\n\tPyArray_Typecode typecode = {PyArray_BOOL, 0, 0};\n\n\tif (!PyArg_ParseTuple(args, \"O\", &obj)) return NULL;\n\n\tarr = PyArray_FromAny(obj, &typecode, 0, 0, FORCECAST);\n\treturn PyArray_Return((PyArrayObject *)arr);\n}\n\nstatic PyObject *\nvoid_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj, *arr;\n\tulonglong memu=1;\n\tPyObject *new=NULL;\n\tPyArray_Typecode typecode = {PyArray_VOID, 0, 0};\n\tchar *destptr;\n\n\tif (!PyArg_ParseTuple(args, \"O\", &obj)) return NULL;\n\t/* For a VOID scalar first see if obj is an integer or long \n\t    and create new memory of that size (filled with 0) for the scalar\n\t*/\n\n\tif (PyLong_Check(obj) || PyInt_Check(obj) || \\\n\t    PyArray_IsScalar(obj, Integer) ||\n\t    (PyArray_Check(obj) && PyArray_NDIM(obj)==0 &&\t\\\n\t     PyArray_ISINTEGER(obj))) {\n\t\tnew = obj->ob_type->tp_as_number->nb_long(obj);\n\t}\n\tif (new && PyLong_Check(new)) {\n\t\tPyObject *ret;\n\t\tmemu = PyLong_AsUnsignedLongLong(new);\n\t\tPy_DECREF(new);\n\t\tif (PyErr_Occurred() || (memu > MAX_INT)) {\n\t\t\tPyErr_Clear();\n\t\t\tPyErr_Format(PyExc_OverflowError, \n\t\t\t\t     \"size must be smaller than %d\",\n\t\t\t\t     (int) MAX_INT);\n\t\t\treturn NULL;\n\t\t}\n\t\tdestptr = PyDataMem_NEW((int) memu);\n\t\tif (destptr == NULL) return PyErr_NoMemory();\n\t\tret = type->tp_alloc(type, 0);\n\t\tif (ret == NULL) {\n\t\t\tPyDataMem_FREE(destptr);\n\t\t\treturn PyErr_NoMemory();\n\t\t}\n\t\t((PyVoidScalarObject *)ret)->obval = destptr;\n\t\t((PyVoidScalarObject *)ret)->ob_size = (int) memu;\n\t\tmemset(destptr, '\\0', (size_t) memu);\n\t\treturn ret;\n\t}\n\n\tarr = PyArray_FromAny(obj, &typecode, 0, 0, FORCECAST);\n\treturn PyArray_Return((PyArrayObject *)arr);\n}\n\n\n/****************  Define Hash functions ********************/\n\n/**begin repeat\n#lname=bool,ubyte,ushort#\n#name=Bool,UByte, UShort#\n */\nstatic long\n@lname@_arrtype_hash(PyObject *obj)\n{\n        return (long)(((Py@name@ScalarObject *)obj)->obval);\n}\n/**end repeat**/\n\n/**begin repeat\n#lname=byte,short,uint,ulong#\n#name=Byte,Short,UInt,ULong#\n */\nstatic long\n@lname@_arrtype_hash(PyObject *obj)\n{\n        long x = (long)(((Py@name@ScalarObject *)obj)->obval);\n        if (x == -1) x=-2;\n        return x;\n}\n/**end repeat**/\n\n#if SIZEOF_INT != SIZEOF_LONG\nstatic long\nint_arrtype_hash(PyObject *obj)\n{\n        long x = (long)(((PyIntScalarObject *)obj)->obval);\n        if (x == -1) x=-2;\n        return x;\n}\n#endif\n\n/**begin repeat\n#char=,u#\n#Char=,U#\n#ext=&& (x >= LONG_MIN),#\n*/\n#if SIZEOF_LONG != SIZEOF_LONGLONG\n/* we assume SIZEOF_LONGLONG=2*SIZEOF_LONG */\nstatic long\n@char@longlong_arrtype_hash(PyObject *obj)\n{\n        long y;\n        @char@longlong x = (((Py@Char@LongLongScalarObject *)obj)->obval);\n\n        if ((x <= LONG_MAX)@ext@) {\n                y = (long) x;\n        }\n        else {\n                union Mask {\n                        long hashvals[2];\n                        @char@longlong v;\n                } both;\n\n                both.v = x;\n                y = both.hashvals[0] + (1000003)*both.hashvals[1];\n        }\n        if (y == -1) y = -2;\n        return y;\n}\n#endif\n/**end repeat**/\n\n#if SIZEOF_LONG==SIZEOF_LONGLONG\nstatic long\nulonglong_arrtype_hash(PyObject *obj)\n{\n        long x = (long)(((PyULongLongScalarObject *)obj)->obval);\n        if (x == -1) x=-2;\n        return x;\n}\n#endif\n\n\n\n/* Wrong thing to do for longdouble, but....*/\n/**begin repeat\n#lname=float, longdouble#\n#name=Float, LongDouble#\n */\nstatic long\n@lname@_arrtype_hash(PyObject *obj)\n{\n        return _Py_HashDouble((double) ((Py@name@ScalarObject *)obj)->obval);\n}\n\n/* borrowed from complex_hash */\nstatic long\nc@lname@_arrtype_hash(PyObject *obj)\n{\n        long hashreal, hashimag, combined;\n        hashreal = _Py_HashDouble((double)                              \\\n                                  (((PyC@name@ScalarObject *)obj)->obval).real);\n\n        if (hashreal == -1) return -1;\n        hashimag = _Py_HashDouble((double)                              \\\n                                  (((PyC@name@ScalarObject *)obj)->obval).imag);\n        if (hashimag == -1) return -1;\n\n        combined = hashreal + 1000003 * hashimag;\n        if (combined == -1) combined = -2;\n        return combined;\n}\n/**end repeat**/\n\nstatic long\nobject_arrtype_hash(PyObject *obj)\n{\n        return PyObject_Hash(((PyObjectScalarObject *)obj)->obval);\n}\n\n/* just hash the pointer */\nstatic long\nvoid_arrtype_hash(PyObject *obj)\n{\n        return _Py_HashPointer((void *)(((PyVoidScalarObject *)obj)->obval));\n}\n\n/**begin repeat\n#name=bool, string, unicode, void, object#\n#NAME=Bool, String, Unicode, Void, Object#\n*/\nstatic PyTypeObject Py@NAME@ArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"@name@_arrtype\",\t                  /*tp_name*/\n        sizeof(Py@NAME@ScalarObject),\t          /*tp_basicsize*/\n};\n/**end repeat**/\n\n/**begin repeat\n#NAME=Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#\n#name=int*5, uint*5, float*3, complex*3#\n#CNAME=(CHAR, SHORT, INT, LONG, LONGLONG)*2, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#\n*/\nstatic PyTypeObject Py@NAME@ArrType_Type = { \n        PyObject_HEAD_INIT(NULL)\n        0,\t\t\t\t\t  /*ob_size*/\n        \"@name@\" STRBITSOF_@CNAME@ \"_arrtype\",\t  /*tp_name*/\n        sizeof(Py@NAME@ScalarObject),\t          /*tp_basicsize*/\n};\n\n/**end repeat**/\n\n\n\n\nstatic PyNumberMethods longdoubletype_as_number;\nstatic PyNumberMethods clongdoubletype_as_number;\n\nstatic void \ninitialize_numeric_types(void)\n{\n\tPyGenericArrType_Type.tp_dealloc = (destructor)gentype_dealloc;\n\tPyGenericArrType_Type.tp_as_number = &gentype_as_number;\n\tPyGenericArrType_Type.tp_as_buffer = &gentype_as_buffer;\n\tPyGenericArrType_Type.tp_flags = BASEFLAGS;\n\tPyGenericArrType_Type.tp_methods = gentype_methods;\n\tPyGenericArrType_Type.tp_getset = gentype_getsets;\n\tPyGenericArrType_Type.tp_new = NULL;\n\tPyGenericArrType_Type.tp_free = PyObject_Del;\n\tPyGenericArrType_Type.tp_repr = gentype_repr;\n\tPyGenericArrType_Type.tp_str = gentype_str;\n\tPyGenericArrType_Type.tp_richcompare = gentype_richcompare;\n\n\t/**begin repeat\n#NAME=Numeric, Integer, SignedInteger, UnsignedInteger, Inexact, Floating, \nComplexFloating, Flexible, Character#\n\t*/\n        Py@NAME@ArrType_Type.tp_flags = BASEFLAGS;\n\t/**end repeat**/\n\n\t/**begin repeat\n#name=bool, byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, void, object#\n#NAME=Bool, Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, String, Unicode, Void, Object#\n\t*/\n\tPy@NAME@ArrType_Type.tp_flags = LEAFFLAGS;\n\tPy@NAME@ArrType_Type.tp_new = @name@_arrtype_new;\n\tPy@NAME@ArrType_Type.tp_richcompare = gentype_richcompare;\n\t/**end repeat**/\n\t/* Allow the Void type to be subclassed -- for adding new types */\n\tPyVoidArrType_Type.tp_flags = BASEFLAGS;\n\n        /**begin repeat\n#name=bool, byte, short, ubyte, ushort, uint, ulong, ulonglong, float, longdouble, cfloat, clongdouble, void, object#\n#NAME=Bool, Byte, Short, UByte, UShort, UInt, ULong, ULongLong, Float, LongDouble, CFloat, CLongDouble, Void, Object#\n        */\n        Py@NAME@ArrType_Type.tp_hash = @name@_arrtype_hash;\n        /**end repeat**/\n\n#if SIZEOF_INT != SIZEOF_LONG\n        /* We won't be inheriting from Python Int type. */\n        PyIntArrType_Type.tp_hash = int_arrtype_hash;\n#endif\n\n#if SIZEOF_LONG != SIZEOF_LONGLONG\n        /* We won't be inheriting from Python Int type. */\n        PyLongLongArrType_Type.tp_hash = longlong_arrtype_hash;\n#endif\n\n\t/* These need to be coded specially because getitem does not\n\t   return a normal Python type\n\t*/\n\tPyLongDoubleArrType_Type.tp_as_number = &longdoubletype_as_number;\n\tPyCLongDoubleArrType_Type.tp_as_number = &clongdoubletype_as_number;\n\n\t/**begin repeat\n#name=int, long, hex, oct, float, repr, str#\n#kind=tp_as_number->nb*5, tp*2#\n\t*/\n\tPyLongDoubleArrType_Type.@kind@_@name@ = longdoubletype_@name@;\n\tPyCLongDoubleArrType_Type.@kind@_@name@ = clongdoubletype_@name@;\n\t/**end repeat**/\n\n\tPyStringArrType_Type.tp_itemsize = sizeof(char);\n\tPyStringArrType_Type.tp_dealloc = string_arrtype_dealloc;\n\tPyFlexibleArrType_Type.tp_dealloc = flexible_dealloc;\n\tPyObjectArrType_Type.tp_dealloc = object_arrtype_dealloc;\n\n\tPyArrayIter_Type.tp_iter = PyObject_SelfIter;\n\tPyArrayMapIter_Type.tp_iter = PyObject_SelfIter;\n}\n\n\nstatic PyTypeObject *typeobjects[] = {\n\t&PyBoolArrType_Type,\n\t&PyByteArrType_Type,\n\t&PyUByteArrType_Type,\n\t&PyShortArrType_Type,\n\t&PyUShortArrType_Type,\n\t&PyIntArrType_Type,\n\t&PyUIntArrType_Type,\n\t&PyLongArrType_Type,\n\t&PyULongArrType_Type,\n\t&PyLongLongArrType_Type,\n\t&PyULongLongArrType_Type,\n\t&PyFloatArrType_Type,\n\t&PyDoubleArrType_Type,\n\t&PyLongDoubleArrType_Type,\n\t&PyCFloatArrType_Type,\n\t&PyCDoubleArrType_Type,\n\t&PyCLongDoubleArrType_Type,\n\t&PyObjectArrType_Type,\n\t&PyStringArrType_Type,\n\t&PyUnicodeArrType_Type,\n\t&PyVoidArrType_Type\n};\n\n\nstatic int\nPyArray_TypenumFromTypeObject(PyObject *type) \n{\n\tint typenum, i;\n\n\ttypenum = PyArray_NOTYPE;\n        i = 0;\n\twhile(i < PyArray_NTYPES) {\n\t\tif (type == (PyObject *)typeobjects[i]) {\n\t\t\ttypenum = i;\n\t\t\tbreak;\n\t\t}\n                i++;\n\t}\n\tif (typenum != PyArray_NOTYPE)\n\t\treturn typenum;\n\n\t/* Find registered types */\n\t\n\t/* here */\n\n\t/* Convert generic types to specific types */\n\tif ((type == (PyObject *) &PyNumericArrType_Type) || \\\n\t    (type == (PyObject *) &PyInexactArrType_Type) || \\\n\t    (type == (PyObject *) &PyFloatingArrType_Type))\n\t\treturn PyArray_DOUBLE;\n\telse if (type == (PyObject *)&PyComplexFloatingArrType_Type)\n\t\treturn PyArray_CDOUBLE;\n\telse if ((type == (PyObject *)&PyIntegerArrType_Type) ||\t\\\n\t\t (type == (PyObject *)&PySignedIntegerArrType_Type))\n\t\treturn PyArray_LONG;\n\telse if (type == (PyObject *) &PyUnsignedIntegerArrType_Type)\n\t\treturn PyArray_ULONG;\n        else if (type == (PyObject *) &PyCharacterArrType_Type)\n\t\treturn PyArray_STRING;\n\telse if (type == (PyObject *) &PyFlexibleArrType_Type)\n\t\treturn PyArray_VOID;\n\telse if (type == (PyObject *)&PyBool_Type)\n\t\ttypenum = PyArray_BOOL;\n\telse if (type == (PyObject *)&PyInt_Type)\n\t\ttypenum = PyArray_LONG;\n\telse if (type == (PyObject *)&PyFloat_Type)\n\t\ttypenum = PyArray_DOUBLE;\t\n\telse if (type == (PyObject *)&PyComplex_Type)\n\t\ttypenum = PyArray_CDOUBLE;\n\telse if (type == (PyObject *)&PyString_Type)\n\t\ttypenum = PyArray_STRING;\n\telse if (type == (PyObject *)&PyUnicode_Type)\n\t\ttypenum = PyArray_UNICODE;\n\telse if (type == (PyObject *)&PyBuffer_Type)\n\t\ttypenum = PyArray_VOID;\n\telse\n\t\ttypenum = PyArray_OBJECT;\n\treturn typenum;\n}\n\nstatic void \nPyArray_TypecodeFromTypeObject(PyObject *type, PyArray_Typecode *typecode) {\n\tint itemsize = 0;\n\tint type_num;\n\n\ttype_num = PyArray_TypenumFromTypeObject(type);\n\ttypecode->type_num = type_num;\n\n\tif (PyTypeNum_ISFLEXIBLE(type_num)) {\n                itemsize = 0;\n\t}\n\telse {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(type_num);\n\t\tif (descr != NULL)\n\t\t\titemsize = descr->elsize;\n\t}\n\ttypecode->itemsize = itemsize;\n\treturn;\n}\n\nstatic void \nPyArray_TypecodeFromScalar(PyObject *sc, PyArray_Typecode *typecode)\n{\n\tint type_num;\n\n        PyArray_TypecodeFromTypeObject((PyObject *)sc->ob_type, typecode);\n        if (typecode->itemsize == 0) {\n                type_num = typecode->type_num;\n\t\tif (type_num == PyArray_STRING) \n\t\t\ttypecode->itemsize = PyString_GET_SIZE(sc);\n\t\telse if (type_num == PyArray_UNICODE)\n\t\t\ttypecode->itemsize = PyUnicode_GET_DATA_SIZE(sc);\n\t\telse if (type_num == PyArray_VOID) {\n\t\t\ttypecode->itemsize = \\\n\t\t\t\t((PyVoidScalarObject *)sc)->ob_size;\n\t\t}\n        }\n\treturn;\n}\n\nstatic PyObject *\nPyArray_TypeObjectFromType(int type)\n{\n\tPyArray_Descr *descr;\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr == NULL) return NULL;\n\tPy_INCREF((PyObject *)descr->typeobj);\n\treturn (PyObject *)descr->typeobj;\n}\n\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [
                        "static PyObject *",
                        "gentype_dataptr_get(PyObject *self)",
                        "{",
                        "\treturn PyString_FromString(\"\");",
                        "}",
                        "",
                        "\t (getter)gentype_dataptr_get,"
                    ],
                    "deleted": [
                        "\t (getter)gentype_data_get,"
                    ]
                }
            }
        ]
    },
    {
        "hash": "ad2119d043f4d730536f0ccc49c687d1b8654b5e",
        "msg": "Fixed more add_data_dir/add_data_files bugs.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T12:00:20+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T12:00:20+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "b28109b23d395d89f90c0ef248501368c801f539"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 23,
        "insertions": 46,
        "lines": 69,
        "files": 1,
        "dmm_unit_size": 0.1111111111111111,
        "dmm_unit_complexity": 0.1111111111111111,
        "dmm_unit_interfacing": 0.9444444444444444,
        "modified_files": [
            {
                "old_path": "scipy/distutils/misc_util.py",
                "new_path": "scipy/distutils/misc_util.py",
                "filename": "misc_util.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -244,8 +244,11 @@ def get_data_files(data):\n                 continue\n         if is_local_src_dir(s):\n             os.path.walk(s,_gsf_visit_func,filenames)\n-        elif type(s) is type('') and os.path.isfile(s):\n-            filenames.append(s)\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@@ -292,6 +295,7 @@ def __init__(self,\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@@ -433,9 +437,9 @@ def add_data_dir(self,data_path):\n             os.path.walk(path, _gsf_visit_func,filenames)\n             if not os.path.isabs(path):\n                 if d is None:\n-                    ds = path\n+                    ds = os.path.join(*(self.name.split('.')+[data_path]))\n                 else:\n-                    ds = os.path.join(*([d]+os.path.normpath(path).split()[1:]))\n+                    ds = os.path.join(d,data_path)\n                 self.add_data_files((ds,filenames))\n             else:\n                 if d is None:\n@@ -447,34 +451,47 @@ def add_data_dir(self,data_path):\n     def add_data_files(self,*files):\n         \"\"\" Add data files to configuration data_files.\n         Argument(s) can be either\n-        - 2-sequence (<datadir suffix>,<path to data file(s)>)\n-        - paths to data files where python datadir suffix defaults\n+        - 2-sequence (<datadir prefix>,<path to data file(s)>)\n+        - paths to data files where python datadir prefix defaults\n           to package dir.\n-        If path is not absolute then it's datadir suffix is\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 type(''):\n+            if type(p) is not type(()):\n                 d = os.path.join(*(self.name.split('.')))\n-                file_list = self.paths(p)\n-                if not os.path.isabs(p):\n+                if type(p) is type('') and not os.path.isabs(p):\n                     d = appendpath(d,os.path.dirname(p))\n-            elif type(p) is type(()):\n-                assert len(p)==2,`p`\n-                d = p[0]\n-                if type(p[1]) is type(''):\n-                    file_list = self.paths(p[1])\n-                else:\n-                    file_list = self.paths(*p[1])\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-                # function\n-                d = os.path.join(*(self.name.split('.')))\n-                file_list = [p]\n-            if not data_dict.has_key(d):\n-                data_dict[d] = file_list[:]\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-                data_dict[d].extend(file_list)\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@@ -482,7 +499,11 @@ def add_data_files(self,*files):\n         else:\n             self.data_files.extend(data_dict.items())\n         return            \n+\n+    def _common_prefix(self,files):\n+        nof_path_components = [len(f.split(os.sep)) for f in files]\n         \n+    \n     def add_include_dirs(self,*paths):\n         \"\"\" Add paths to configuration include directories.\n         \"\"\"\n@@ -820,6 +841,8 @@ def rm_file(f=target):\n \n             return target\n \n+        #d = os.path.join(*(self.name.split('.')))\n+        #self.add_data_files((d,generate_svn_version_py()))\n         self.add_data_files(generate_svn_version_py())\n         return\n \n",
                "added_lines": 46,
                "deleted_lines": 23,
                "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:\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<name>[\\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 = build_info.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    scipy_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 (<datadir suffix>,<path to data directory>)\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 (<datadir prefix>,<path to data file(s)>)\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 _common_prefix(self,files):\n        nof_path_components = [len(f.split(os.sep)) for f in files]\n        \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 (<includedir suffix>,<path to header file(s)>)\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 scipy.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 scipy.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<revision>\\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        self.add_data_files(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_scipy_include_dirs():\n    include_dirs = Configuration.scipy_include_dirs[:]\n    if not include_dirs:\n        import scipy.base as base\n        include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n        #from distutils.sysconfig import get_python_inc\n        #prefix = []\n        #for name in scipy.__file__.split(os.sep):\n        #    if name=='lib':\n        #        break\n        #    prefix.append(name)\n        #include_dirs.append(get_python_inc(prefix=os.sep.join(prefix)))\n    return include_dirs\n\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 os.path.isabs(path):\n        absprefix = os.path.abspath(prefix)\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(prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n    \"\"\" Generate <package>/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 scipy.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:\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<name>[\\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 = build_info.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('') and os.path.isfile(s):\n            filenames.append(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    scipy_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        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 (<datadir suffix>,<path to data directory>)\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 = path\n                else:\n                    ds = os.path.join(*([d]+os.path.normpath(path).split()[1:]))\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 (<datadir suffix>,<path to data file(s)>)\n        - paths to data files where python datadir suffix defaults\n          to package dir.\n        If path is not absolute then it's datadir suffix is\n        package dir + dirname of the path.\n        \"\"\"\n        data_dict = {}\n        for p in files:\n            if type(p) is type(''):\n                d = os.path.join(*(self.name.split('.')))\n                file_list = self.paths(p)\n                if not os.path.isabs(p):\n                    d = appendpath(d,os.path.dirname(p))\n            elif type(p) is type(()):\n                assert len(p)==2,`p`\n                d = p[0]\n                if type(p[1]) is type(''):\n                    file_list = self.paths(p[1])\n                else:\n                    file_list = self.paths(*p[1])\n            else:\n                # function\n                d = os.path.join(*(self.name.split('.')))\n                file_list = [p]\n            if not data_dict.has_key(d):\n                data_dict[d] = file_list[:]\n            else:\n                data_dict[d].extend(file_list)\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 (<includedir suffix>,<path to header file(s)>)\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 scipy.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 scipy.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<revision>\\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        self.add_data_files(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_scipy_include_dirs():\n    include_dirs = Configuration.scipy_include_dirs[:]\n    if not include_dirs:\n        import scipy.base as base\n        include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n        #from distutils.sysconfig import get_python_inc\n        #prefix = []\n        #for name in scipy.__file__.split(os.sep):\n        #    if name=='lib':\n        #        break\n        #    prefix.append(name)\n        #include_dirs.append(get_python_inc(prefix=os.sep.join(prefix)))\n    return include_dirs\n\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 os.path.isabs(path):\n        absprefix = os.path.abspath(prefix)\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(prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n    \"\"\" Generate <package>/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 scipy.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": 129,
                        "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": 108,
                        "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": "_common_prefix",
                        "long_name": "_common_prefix( self , files )",
                        "filename": "misc_util.py",
                        "nloc": 2,
                        "complexity": 2,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "files"
                        ],
                        "start_line": 503,
                        "end_line": 504,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "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": 507,
                        "end_line": 516,
                        "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": 518,
                        "end_line": 537,
                        "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": 539,
                        "end_line": 560,
                        "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": 562,
                        "end_line": 565,
                        "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": 567,
                        "end_line": 629,
                        "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": 631,
                        "end_line": 655,
                        "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": 657,
                        "end_line": 666,
                        "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": 668,
                        "end_line": 682,
                        "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": 684,
                        "end_line": 693,
                        "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": 695,
                        "end_line": 704,
                        "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": 706,
                        "end_line": 709,
                        "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": 711,
                        "end_line": 722,
                        "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": 724,
                        "end_line": 735,
                        "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": 737,
                        "end_line": 750,
                        "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": 752,
                        "end_line": 763,
                        "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": 765,
                        "end_line": 811,
                        "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": 835,
                        "end_line": 839,
                        "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": 824,
                        "end_line": 842,
                        "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": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 813,
                        "end_line": 847,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 849,
                        "end_line": 854,
                        "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": 856,
                        "end_line": 866,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "get_scipy_include_dirs",
                        "long_name": "get_scipy_include_dirs( )",
                        "filename": "misc_util.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [],
                        "start_line": 868,
                        "end_line": 880,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 884,
                        "end_line": 889,
                        "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": 13,
                        "complexity": 5,
                        "token_count": 157,
                        "parameters": [
                            "prefix",
                            "path"
                        ],
                        "start_line": 891,
                        "end_line": 904,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "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": 906,
                        "end_line": 942,
                        "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": 944,
                        "end_line": 971,
                        "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": 129,
                        "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": 108,
                        "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": 17,
                        "complexity": 8,
                        "token_count": 105,
                        "parameters": [
                            "data"
                        ],
                        "start_line": 235,
                        "end_line": 251,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 17,
                        "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": 253,
                        "end_line": 254,
                        "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": 256,
                        "end_line": 263,
                        "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": 40,
                        "complexity": 11,
                        "token_count": 335,
                        "parameters": [
                            "self",
                            "package_name",
                            "parent_name",
                            "top_path",
                            "package_path",
                            "attrs"
                        ],
                        "start_line": 275,
                        "end_line": 323,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 325,
                        "end_line": 336,
                        "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": 338,
                        "end_line": 339,
                        "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": 341,
                        "end_line": 344,
                        "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": 346,
                        "end_line": 390,
                        "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": 392,
                        "end_line": 411,
                        "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": 187,
                        "parameters": [
                            "self",
                            "data_path"
                        ],
                        "start_line": 413,
                        "end_line": 445,
                        "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": 28,
                        "complexity": 8,
                        "token_count": 247,
                        "parameters": [
                            "self",
                            "files"
                        ],
                        "start_line": 447,
                        "end_line": 484,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 38,
                        "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": 486,
                        "end_line": 495,
                        "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": 497,
                        "end_line": 516,
                        "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": 518,
                        "end_line": 539,
                        "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": 541,
                        "end_line": 544,
                        "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": 546,
                        "end_line": 608,
                        "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": 610,
                        "end_line": 634,
                        "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": 636,
                        "end_line": 645,
                        "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": 647,
                        "end_line": 661,
                        "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": 663,
                        "end_line": 672,
                        "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": 674,
                        "end_line": 683,
                        "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": 685,
                        "end_line": 688,
                        "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": 690,
                        "end_line": 701,
                        "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": 703,
                        "end_line": 714,
                        "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": 716,
                        "end_line": 729,
                        "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": 731,
                        "end_line": 742,
                        "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": 744,
                        "end_line": 790,
                        "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": 814,
                        "end_line": 818,
                        "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": 803,
                        "end_line": 821,
                        "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": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 792,
                        "end_line": 824,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "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": 826,
                        "end_line": 831,
                        "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": 833,
                        "end_line": 843,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "get_scipy_include_dirs",
                        "long_name": "get_scipy_include_dirs( )",
                        "filename": "misc_util.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [],
                        "start_line": 845,
                        "end_line": 857,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 861,
                        "end_line": 866,
                        "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": 13,
                        "complexity": 5,
                        "token_count": 157,
                        "parameters": [
                            "prefix",
                            "path"
                        ],
                        "start_line": 868,
                        "end_line": 881,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "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": 883,
                        "end_line": 919,
                        "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": 921,
                        "end_line": 948,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "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": "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": "_common_prefix",
                        "long_name": "_common_prefix( self , files )",
                        "filename": "misc_util.py",
                        "nloc": 2,
                        "complexity": 2,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "files"
                        ],
                        "start_line": 503,
                        "end_line": 504,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "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": "__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": "make_svn_version_py",
                        "long_name": "make_svn_version_py( self )",
                        "filename": "misc_util.py",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 813,
                        "end_line": 847,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 1
                    }
                ],
                "nloc": 720,
                "complexity": 230,
                "token_count": 5321,
                "diff_parsed": {
                    "added": [
                        "        elif type(s) is type(''):",
                        "            if os.path.isfile(s):",
                        "                filenames.append(s)",
                        "            else:",
                        "                print 'Not existing data file:',s",
                        "        assert os.path.isdir(package_path),`package_path`",
                        "                    ds = os.path.join(*(self.name.split('.')+[data_path]))",
                        "                    ds = os.path.join(d,data_path)",
                        "        - 2-sequence (<datadir prefix>,<path to data file(s)>)",
                        "        - paths to data files where python datadir prefix defaults",
                        "        If path is not absolute then it's datadir prefix is",
                        "        new_files = []",
                        "            if type(p) is not type(()):",
                        "                if type(p) is type('') and not os.path.isabs(p):",
                        "                p = (d,p)",
                        "            new_files.append(p)",
                        "        files = []",
                        "        for prefix,filepattern in new_files:",
                        "            if type(filepattern) is type(''):",
                        "                file_list = self.paths(filepattern)",
                        "            elif callable(filepattern):",
                        "                file_list = [filepattern]",
                        "                file_list = self.paths(*filepattern)",
                        "",
                        "            nof_path_components = [len(f.split(os.sep)) \\",
                        "                                   for f in file_list if type(f) is type('')]",
                        "            if nof_path_components:",
                        "                min_path_components = min(nof_path_components)-1",
                        "                min_path_components = 0",
                        "",
                        "            for f in file_list:",
                        "                if type(f) is type(''):",
                        "                    extra_path_components = f.split(os.sep)[min_path_components:-1]",
                        "                    p = os.path.join(*([prefix]+extra_path_components))",
                        "                else:",
                        "                    p = prefix",
                        "                if not data_dict.has_key(p):",
                        "                    data_dict[p] = [f]",
                        "                else:",
                        "                    data_dict[p].append(f)",
                        "",
                        "    def _common_prefix(self,files):",
                        "        nof_path_components = [len(f.split(os.sep)) for f in files]",
                        "",
                        "        #d = os.path.join(*(self.name.split('.')))",
                        "        #self.add_data_files((d,generate_svn_version_py()))"
                    ],
                    "deleted": [
                        "        elif type(s) is type('') and os.path.isfile(s):",
                        "            filenames.append(s)",
                        "                    ds = path",
                        "                    ds = os.path.join(*([d]+os.path.normpath(path).split()[1:]))",
                        "        - 2-sequence (<datadir suffix>,<path to data file(s)>)",
                        "        - paths to data files where python datadir suffix defaults",
                        "        If path is not absolute then it's datadir suffix is",
                        "            if type(p) is type(''):",
                        "                file_list = self.paths(p)",
                        "                if not os.path.isabs(p):",
                        "            elif type(p) is type(()):",
                        "                assert len(p)==2,`p`",
                        "                d = p[0]",
                        "                if type(p[1]) is type(''):",
                        "                    file_list = self.paths(p[1])",
                        "                else:",
                        "                    file_list = self.paths(*p[1])",
                        "                # function",
                        "                d = os.path.join(*(self.name.split('.')))",
                        "                file_list = [p]",
                        "            if not data_dict.has_key(d):",
                        "                data_dict[d] = file_list[:]",
                        "                data_dict[d].extend(file_list)"
                    ]
                }
            }
        ]
    },
    {
        "hash": "1993327e32eaa577a4f2da142c2580af44013433",
        "msg": "Clean up.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T12:01:14+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T12:01:14+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "ad2119d043f4d730536f0ccc49c687d1b8654b5e"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 6,
        "insertions": 0,
        "lines": 6,
        "files": 1,
        "dmm_unit_size": 0.0,
        "dmm_unit_complexity": 0.0,
        "dmm_unit_interfacing": 0.0,
        "modified_files": [
            {
                "old_path": "scipy/distutils/misc_util.py",
                "new_path": "scipy/distutils/misc_util.py",
                "filename": "misc_util.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -499,10 +499,6 @@ def add_data_files(self,*files):\n         else:\n             self.data_files.extend(data_dict.items())\n         return            \n-\n-    def _common_prefix(self,files):\n-        nof_path_components = [len(f.split(os.sep)) for f in files]\n-        \n     \n     def add_include_dirs(self,*paths):\n         \"\"\" Add paths to configuration include directories.\n@@ -841,8 +837,6 @@ def rm_file(f=target):\n \n             return target\n \n-        #d = os.path.join(*(self.name.split('.')))\n-        #self.add_data_files((d,generate_svn_version_py()))\n         self.add_data_files(generate_svn_version_py())\n         return\n \n",
                "added_lines": 0,
                "deleted_lines": 6,
                "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:\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<name>[\\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 = build_info.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    scipy_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 (<datadir suffix>,<path to data directory>)\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 (<datadir prefix>,<path to data file(s)>)\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 (<includedir suffix>,<path to header file(s)>)\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 scipy.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 scipy.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<revision>\\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        self.add_data_files(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_scipy_include_dirs():\n    include_dirs = Configuration.scipy_include_dirs[:]\n    if not include_dirs:\n        import scipy.base as base\n        include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n        #from distutils.sysconfig import get_python_inc\n        #prefix = []\n        #for name in scipy.__file__.split(os.sep):\n        #    if name=='lib':\n        #        break\n        #    prefix.append(name)\n        #include_dirs.append(get_python_inc(prefix=os.sep.join(prefix)))\n    return include_dirs\n\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 os.path.isabs(path):\n        absprefix = os.path.abspath(prefix)\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(prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n    \"\"\" Generate <package>/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 scipy.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:\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<name>[\\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 = build_info.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    scipy_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 (<datadir suffix>,<path to data directory>)\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 (<datadir prefix>,<path to data file(s)>)\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 _common_prefix(self,files):\n        nof_path_components = [len(f.split(os.sep)) for f in files]\n        \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 (<includedir suffix>,<path to header file(s)>)\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 scipy.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 scipy.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<revision>\\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        self.add_data_files(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_scipy_include_dirs():\n    include_dirs = Configuration.scipy_include_dirs[:]\n    if not include_dirs:\n        import scipy.base as base\n        include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n        #from distutils.sysconfig import get_python_inc\n        #prefix = []\n        #for name in scipy.__file__.split(os.sep):\n        #    if name=='lib':\n        #        break\n        #    prefix.append(name)\n        #include_dirs.append(get_python_inc(prefix=os.sep.join(prefix)))\n    return include_dirs\n\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 os.path.isabs(path):\n        absprefix = os.path.abspath(prefix)\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(prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n    \"\"\" Generate <package>/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 scipy.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": 129,
                        "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": 108,
                        "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": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 809,
                        "end_line": 841,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "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": 843,
                        "end_line": 848,
                        "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": 850,
                        "end_line": 860,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "get_scipy_include_dirs",
                        "long_name": "get_scipy_include_dirs( )",
                        "filename": "misc_util.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [],
                        "start_line": 862,
                        "end_line": 874,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 878,
                        "end_line": 883,
                        "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": 13,
                        "complexity": 5,
                        "token_count": 157,
                        "parameters": [
                            "prefix",
                            "path"
                        ],
                        "start_line": 885,
                        "end_line": 898,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "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": 900,
                        "end_line": 936,
                        "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": 938,
                        "end_line": 965,
                        "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": 129,
                        "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": 108,
                        "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": "_common_prefix",
                        "long_name": "_common_prefix( self , files )",
                        "filename": "misc_util.py",
                        "nloc": 2,
                        "complexity": 2,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "files"
                        ],
                        "start_line": 503,
                        "end_line": 504,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "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": 507,
                        "end_line": 516,
                        "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": 518,
                        "end_line": 537,
                        "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": 539,
                        "end_line": 560,
                        "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": 562,
                        "end_line": 565,
                        "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": 567,
                        "end_line": 629,
                        "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": 631,
                        "end_line": 655,
                        "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": 657,
                        "end_line": 666,
                        "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": 668,
                        "end_line": 682,
                        "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": 684,
                        "end_line": 693,
                        "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": 695,
                        "end_line": 704,
                        "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": 706,
                        "end_line": 709,
                        "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": 711,
                        "end_line": 722,
                        "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": 724,
                        "end_line": 735,
                        "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": 737,
                        "end_line": 750,
                        "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": 752,
                        "end_line": 763,
                        "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": 765,
                        "end_line": 811,
                        "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": 835,
                        "end_line": 839,
                        "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": 824,
                        "end_line": 842,
                        "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": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 813,
                        "end_line": 847,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "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": 849,
                        "end_line": 854,
                        "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": 856,
                        "end_line": 866,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "get_scipy_include_dirs",
                        "long_name": "get_scipy_include_dirs( )",
                        "filename": "misc_util.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [],
                        "start_line": 868,
                        "end_line": 880,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 884,
                        "end_line": 889,
                        "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": 13,
                        "complexity": 5,
                        "token_count": 157,
                        "parameters": [
                            "prefix",
                            "path"
                        ],
                        "start_line": 891,
                        "end_line": 904,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "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": 906,
                        "end_line": 942,
                        "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": 944,
                        "end_line": 971,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "make_svn_version_py",
                        "long_name": "make_svn_version_py( self )",
                        "filename": "misc_util.py",
                        "nloc": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 813,
                        "end_line": 847,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_common_prefix",
                        "long_name": "_common_prefix( self , files )",
                        "filename": "misc_util.py",
                        "nloc": 2,
                        "complexity": 2,
                        "token_count": 26,
                        "parameters": [
                            "self",
                            "files"
                        ],
                        "start_line": 503,
                        "end_line": 504,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    }
                ],
                "nloc": 718,
                "complexity": 228,
                "token_count": 5294,
                "diff_parsed": {
                    "added": [],
                    "deleted": [
                        "",
                        "    def _common_prefix(self,files):",
                        "        nof_path_components = [len(f.split(os.sep)) for f in files]",
                        "",
                        "        #d = os.path.join(*(self.name.split('.')))",
                        "        #self.add_data_files((d,generate_svn_version_py()))"
                    ]
                }
            }
        ]
    },
    {
        "hash": "92b786fcdeae8556e4ad4eb924897cfffe4511a1",
        "msg": "Updated f2py/weave setup.py files.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T12:02:16+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T12:02:16+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "1993327e32eaa577a4f2da142c2580af44013433"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 18,
        "insertions": 13,
        "lines": 31,
        "files": 2,
        "dmm_unit_size": 0.0,
        "dmm_unit_complexity": 0.0,
        "dmm_unit_interfacing": 0.0,
        "modified_files": [
            {
                "old_path": "scipy/f2py2e/setup.py",
                "new_path": "scipy/f2py2e/setup.py",
                "filename": "setup.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -29,6 +29,8 @@\n def configuration(parent_package='',top_path=None):\n     config = Configuration('f2py', parent_package, top_path)\n \n+    config.add_data_dir('docs')\n+\n     config.add_data_files('src/fortranobject.c',\n                           'src/fortranobject.h',\n                           'f2py.1'\n@@ -62,9 +64,12 @@ def generate_f2py_py(build_dir):\n     return config\n \n if __name__ == \"__main__\":\n+\n+    config = configuration(top_path='')\n+    version = config.get_version()\n     print 'F2PY Version',version\n+    config = config.todict()\n \n-    config = configuration(top_path='').todict()\n     if sys.version[:3]>='2.3':\n         config['download_url'] = \"http://cens.ioc.ee/projects/f2py2e/2.x\"\\\n                                  \"/F2PY-2-latest.tar.gz\"\n",
                "added_lines": 6,
                "deleted_lines": 1,
                "source_code": "#!/usr/bin/env python\n\"\"\"\nsetup.py for installing F2PY\n\nUsage:\n   python setup.py install\n\nCopyright 2001-2005 Pearu Peterson all rights reserved,\nPearu Peterson <pearu@cens.ioc.ee>          \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$Revision: 1.32 $\n$Date: 2005/01/30 17:22:14 $\nPearu Peterson\n\"\"\"\n\n__version__ = \"$Id: setup.py,v 1.32 2005/01/30 17:22:14 pearu Exp $\"\n\nimport os\nimport sys\nfrom distutils.dep_util import newer\nfrom scipy.distutils.core import setup\nfrom scipy.distutils.misc_util import Configuration\n\nfrom __version__ import version\n\ndef configuration(parent_package='',top_path=None):\n    config = Configuration('f2py', parent_package, top_path)\n\n    config.add_data_dir('docs')\n\n    config.add_data_files('src/fortranobject.c',\n                          'src/fortranobject.h',\n                          'f2py.1'\n                          )\n\n    config.make_svn_version_py()\n\n    def generate_f2py_py(build_dir):\n        f2py_exe = 'f2py'+os.path.basename(sys.executable)[6:]\n        if f2py_exe[-4:]=='.exe':\n            f2py_exe = f2py_exe[:-4] + '.py'\n        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':\n            f2py_exe = f2py_exe + '.py'\n        target = os.path.join(build_dir,f2py_exe)\n        if newer(__file__,target):\n            print 'Creating',target\n            f = open(target,'w')\n            f.write('''\\\n#!/usr/bin/env %s\n# See http://cens.ioc.ee/projects/f2py2e/\nimport scipy.f2py as f2py\nf2py.main()\n'''%(os.path.basename(sys.executable)))\n            f.close()\n        return target\n\n    config.add_scripts(generate_f2py_py)\n\n    print 'F2PY Version',config.get_version()\n\n    return config\n\nif __name__ == \"__main__\":\n\n    config = configuration(top_path='')\n    version = config.get_version()\n    print 'F2PY Version',version\n    config = config.todict()\n\n    if sys.version[:3]>='2.3':\n        config['download_url'] = \"http://cens.ioc.ee/projects/f2py2e/2.x\"\\\n                                 \"/F2PY-2-latest.tar.gz\"\n        config['classifiers'] = [\n            'Development Status :: 5 - Production/Stable',\n            'Intended Audience :: Developers',\n            'Intended Audience :: Science/Research',\n            'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',\n            'Natural Language :: English',\n            'Operating System :: OS Independent',\n            'Programming Language :: C',\n            'Programming Language :: Fortran',\n            'Programming Language :: Python',\n            'Topic :: Scientific/Engineering',\n            'Topic :: Software Development :: Code Generators',\n            ]\n    setup(version=version,\n          description       = \"F2PY - Fortran to Python Interface Generaton\",\n          author            = \"Pearu Peterson\",\n          author_email      = \"pearu@cens.ioc.ee\",\n          maintainer        = \"Pearu Peterson\",\n          maintainer_email  = \"pearu@cens.ioc.ee\",\n          license           = \"LGPL\",\n          platforms         = \"Unix, Windows (mingw|cygwin), Mac OSX\",\n          long_description  = \"\"\"\\\nThe Fortran to Python Interface Generator, or F2PY for short, is a\ncommand line tool (f2py) for generating Python C/API modules for\nwrapping Fortran 77/90/95 subroutines, accessing common blocks from\nPython, and calling Python functions from Fortran (call-backs).\nInterfacing subroutines/data from Fortran 90/95 modules is supported.\"\"\",\n          url               = \"http://cens.ioc.ee/projects/f2py2e/\",\n          keywords          = ['Fortran','f2py'],\n          **config)\n",
                "source_code_before": "#!/usr/bin/env python\n\"\"\"\nsetup.py for installing F2PY\n\nUsage:\n   python setup.py install\n\nCopyright 2001-2005 Pearu Peterson all rights reserved,\nPearu Peterson <pearu@cens.ioc.ee>          \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$Revision: 1.32 $\n$Date: 2005/01/30 17:22:14 $\nPearu Peterson\n\"\"\"\n\n__version__ = \"$Id: setup.py,v 1.32 2005/01/30 17:22:14 pearu Exp $\"\n\nimport os\nimport sys\nfrom distutils.dep_util import newer\nfrom scipy.distutils.core import setup\nfrom scipy.distutils.misc_util import Configuration\n\nfrom __version__ import version\n\ndef configuration(parent_package='',top_path=None):\n    config = Configuration('f2py', parent_package, top_path)\n\n    config.add_data_files('src/fortranobject.c',\n                          'src/fortranobject.h',\n                          'f2py.1'\n                          )\n\n    config.make_svn_version_py()\n\n    def generate_f2py_py(build_dir):\n        f2py_exe = 'f2py'+os.path.basename(sys.executable)[6:]\n        if f2py_exe[-4:]=='.exe':\n            f2py_exe = f2py_exe[:-4] + '.py'\n        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':\n            f2py_exe = f2py_exe + '.py'\n        target = os.path.join(build_dir,f2py_exe)\n        if newer(__file__,target):\n            print 'Creating',target\n            f = open(target,'w')\n            f.write('''\\\n#!/usr/bin/env %s\n# See http://cens.ioc.ee/projects/f2py2e/\nimport scipy.f2py as f2py\nf2py.main()\n'''%(os.path.basename(sys.executable)))\n            f.close()\n        return target\n\n    config.add_scripts(generate_f2py_py)\n\n    print 'F2PY Version',config.get_version()\n\n    return config\n\nif __name__ == \"__main__\":\n    print 'F2PY Version',version\n\n    config = configuration(top_path='').todict()\n    if sys.version[:3]>='2.3':\n        config['download_url'] = \"http://cens.ioc.ee/projects/f2py2e/2.x\"\\\n                                 \"/F2PY-2-latest.tar.gz\"\n        config['classifiers'] = [\n            'Development Status :: 5 - Production/Stable',\n            'Intended Audience :: Developers',\n            'Intended Audience :: Science/Research',\n            'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',\n            'Natural Language :: English',\n            'Operating System :: OS Independent',\n            'Programming Language :: C',\n            'Programming Language :: Fortran',\n            'Programming Language :: Python',\n            'Topic :: Scientific/Engineering',\n            'Topic :: Software Development :: Code Generators',\n            ]\n    setup(version=version,\n          description       = \"F2PY - Fortran to Python Interface Generaton\",\n          author            = \"Pearu Peterson\",\n          author_email      = \"pearu@cens.ioc.ee\",\n          maintainer        = \"Pearu Peterson\",\n          maintainer_email  = \"pearu@cens.ioc.ee\",\n          license           = \"LGPL\",\n          platforms         = \"Unix, Windows (mingw|cygwin), Mac OSX\",\n          long_description  = \"\"\"\\\nThe Fortran to Python Interface Generator, or F2PY for short, is a\ncommand line tool (f2py) for generating Python C/API modules for\nwrapping Fortran 77/90/95 subroutines, accessing common blocks from\nPython, and calling Python functions from Fortran (call-backs).\nInterfacing subroutines/data from Fortran 90/95 modules is supported.\"\"\",\n          url               = \"http://cens.ioc.ee/projects/f2py2e/\",\n          keywords          = ['Fortran','f2py'],\n          **config)\n",
                "methods": [
                    {
                        "name": "configuration.generate_f2py_py",
                        "long_name": "configuration.generate_f2py_py( build_dir )",
                        "filename": "setup.py",
                        "nloc": 18,
                        "complexity": 5,
                        "token_count": 122,
                        "parameters": [
                            "build_dir"
                        ],
                        "start_line": 41,
                        "end_line": 58,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 12,
                        "complexity": 1,
                        "token_count": 60,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 29,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "configuration.generate_f2py_py",
                        "long_name": "configuration.generate_f2py_py( build_dir )",
                        "filename": "setup.py",
                        "nloc": 18,
                        "complexity": 5,
                        "token_count": 122,
                        "parameters": [
                            "build_dir"
                        ],
                        "start_line": 39,
                        "end_line": 56,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 18,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 11,
                        "complexity": 1,
                        "token_count": 54,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 29,
                        "end_line": 62,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 12,
                        "complexity": 1,
                        "token_count": 60,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 29,
                        "end_line": 64,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 36,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 90,
                "complexity": 6,
                "token_count": 348,
                "diff_parsed": {
                    "added": [
                        "    config.add_data_dir('docs')",
                        "",
                        "",
                        "    config = configuration(top_path='')",
                        "    version = config.get_version()",
                        "    config = config.todict()"
                    ],
                    "deleted": [
                        "    config = configuration(top_path='').todict()"
                    ]
                }
            },
            {
                "old_path": "scipy/weave/setup.py",
                "new_path": "scipy/weave/setup.py",
                "filename": "setup.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,23 +1,13 @@\n #!/usr/bin/env python\n-\n import os\n-from glob import glob\n-from scipy.distutils.misc_util import get_path, Configuration, dot_join\n-\n-def configuration(parent_package='',parent_path=None):\n-    parent_path2 = parent_path\n-    parent_path = parent_package\n-    local_path = get_path(__name__,parent_path2)\n-    config = Configuration('weave',parent_package)\n-    config.add_subpackage('tests')\n-    scxx_files = glob(os.path.join(local_path,'scxx','*.*'))\n-    install_path = os.path.join(parent_path,'weave','scxx')\n+def configuration(parent_package='',top_path=None):\n+    from scipy.distutils.misc_util import Configuration\n+    config = Configuration('weave',parent_package,top_path)\n+    config.add_data_dir('tests')\n     config.add_data_dir('scxx')\n     config.add_data_dir(os.path.join('blitz','blitz'))\n-    config.add_data_dir(os.path.join('blitz','blitz','array'))\n-    config.add_data_dir(os.path.join('blitz','blitz','meta'))\n-    config.add_data_files(*glob(os.path.join(local_path,'doc','*.html')))\n-    config.add_data_files(*glob(os.path.join(local_path,'examples','*.py')))    \n+    config.add_data_dir('doc')\n+    config.add_data_dir('examples')\n     return config\n \n if __name__ == '__main__':    \n@@ -29,4 +19,4 @@ def configuration(parent_package='',parent_path=None):\n           author_email = \"eric@enthought.com\",\n           licence = \"SciPy License (BSD Style)\",\n           url = 'http://www.scipy.org',\n-          **configuration(parent_path=''))\n+          **configuration(parent_path='').todict())\n",
                "added_lines": 7,
                "deleted_lines": 17,
                "source_code": "#!/usr/bin/env python\nimport os\ndef configuration(parent_package='',top_path=None):\n    from scipy.distutils.misc_util import Configuration\n    config = Configuration('weave',parent_package,top_path)\n    config.add_data_dir('tests')\n    config.add_data_dir('scxx')\n    config.add_data_dir(os.path.join('blitz','blitz'))\n    config.add_data_dir('doc')\n    config.add_data_dir('examples')\n    return config\n\nif __name__ == '__main__':    \n    from scipy.distutils.core import setup\n    from weave_version import weave_version\n    setup(version = weave_version,\n          description = \"Tools for inlining C/C++ in Python\",\n          author = \"Eric Jones\",\n          author_email = \"eric@enthought.com\",\n          licence = \"SciPy License (BSD Style)\",\n          url = 'http://www.scipy.org',\n          **configuration(parent_path='').todict())\n",
                "source_code_before": "#!/usr/bin/env python\n\nimport os\nfrom glob import glob\nfrom scipy.distutils.misc_util import get_path, Configuration, dot_join\n\ndef configuration(parent_package='',parent_path=None):\n    parent_path2 = parent_path\n    parent_path = parent_package\n    local_path = get_path(__name__,parent_path2)\n    config = Configuration('weave',parent_package)\n    config.add_subpackage('tests')\n    scxx_files = glob(os.path.join(local_path,'scxx','*.*'))\n    install_path = os.path.join(parent_path,'weave','scxx')\n    config.add_data_dir('scxx')\n    config.add_data_dir(os.path.join('blitz','blitz'))\n    config.add_data_dir(os.path.join('blitz','blitz','array'))\n    config.add_data_dir(os.path.join('blitz','blitz','meta'))\n    config.add_data_files(*glob(os.path.join(local_path,'doc','*.html')))\n    config.add_data_files(*glob(os.path.join(local_path,'examples','*.py')))    \n    return config\n\nif __name__ == '__main__':    \n    from scipy.distutils.core import setup\n    from weave_version import weave_version\n    setup(version = weave_version,\n          description = \"Tools for inlining C/C++ in Python\",\n          author = \"Eric Jones\",\n          author_email = \"eric@enthought.com\",\n          licence = \"SciPy License (BSD Style)\",\n          url = 'http://www.scipy.org',\n          **configuration(parent_path=''))\n",
                "methods": [
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , top_path = None )",
                        "filename": "setup.py",
                        "nloc": 9,
                        "complexity": 1,
                        "token_count": 70,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 3,
                        "end_line": 11,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , parent_path = None )",
                        "filename": "setup.py",
                        "nloc": 15,
                        "complexity": 1,
                        "token_count": 169,
                        "parameters": [
                            "parent_package",
                            "parent_path"
                        ],
                        "start_line": 7,
                        "end_line": 21,
                        "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": 9,
                        "complexity": 1,
                        "token_count": 70,
                        "parameters": [
                            "parent_package",
                            "top_path"
                        ],
                        "start_line": 3,
                        "end_line": 11,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 9,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "configuration",
                        "long_name": "configuration( parent_package = '' , parent_path = None )",
                        "filename": "setup.py",
                        "nloc": 15,
                        "complexity": 1,
                        "token_count": 169,
                        "parameters": [
                            "parent_package",
                            "parent_path"
                        ],
                        "start_line": 7,
                        "end_line": 21,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 20,
                "complexity": 1,
                "token_count": 128,
                "diff_parsed": {
                    "added": [
                        "def configuration(parent_package='',top_path=None):",
                        "    from scipy.distutils.misc_util import Configuration",
                        "    config = Configuration('weave',parent_package,top_path)",
                        "    config.add_data_dir('tests')",
                        "    config.add_data_dir('doc')",
                        "    config.add_data_dir('examples')",
                        "          **configuration(parent_path='').todict())"
                    ],
                    "deleted": [
                        "",
                        "from glob import glob",
                        "from scipy.distutils.misc_util import get_path, Configuration, dot_join",
                        "",
                        "def configuration(parent_package='',parent_path=None):",
                        "    parent_path2 = parent_path",
                        "    parent_path = parent_package",
                        "    local_path = get_path(__name__,parent_path2)",
                        "    config = Configuration('weave',parent_package)",
                        "    config.add_subpackage('tests')",
                        "    scxx_files = glob(os.path.join(local_path,'scxx','*.*'))",
                        "    install_path = os.path.join(parent_path,'weave','scxx')",
                        "    config.add_data_dir(os.path.join('blitz','blitz','array'))",
                        "    config.add_data_dir(os.path.join('blitz','blitz','meta'))",
                        "    config.add_data_files(*glob(os.path.join(local_path,'doc','*.html')))",
                        "    config.add_data_files(*glob(os.path.join(local_path,'examples','*.py')))",
                        "          **configuration(parent_path=''))"
                    ]
                }
            }
        ]
    },
    {
        "hash": "464b5d560efb3ef231605b7da7b9e9d133a1565d",
        "msg": "Fixed the installation path for __svn_version__.py.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T12:07:13+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T12:07:13+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "92b786fcdeae8556e4ad4eb924897cfffe4511a1"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 1,
        "insertions": 2,
        "lines": 3,
        "files": 1,
        "dmm_unit_size": 1.0,
        "dmm_unit_complexity": 1.0,
        "dmm_unit_interfacing": 1.0,
        "modified_files": [
            {
                "old_path": "scipy/distutils/misc_util.py",
                "new_path": "scipy/distutils/misc_util.py",
                "filename": "misc_util.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -837,7 +837,8 @@ def rm_file(f=target):\n \n             return target\n \n-        self.add_data_files(generate_svn_version_py())\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",
                "added_lines": 2,
                "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:\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<name>[\\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 = build_info.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    scipy_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 (<datadir suffix>,<path to data directory>)\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 (<datadir prefix>,<path to data file(s)>)\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 (<includedir suffix>,<path to header file(s)>)\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 scipy.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 scipy.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<revision>\\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_scipy_include_dirs():\n    include_dirs = Configuration.scipy_include_dirs[:]\n    if not include_dirs:\n        import scipy.base as base\n        include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n        #from distutils.sysconfig import get_python_inc\n        #prefix = []\n        #for name in scipy.__file__.split(os.sep):\n        #    if name=='lib':\n        #        break\n        #    prefix.append(name)\n        #include_dirs.append(get_python_inc(prefix=os.sep.join(prefix)))\n    return include_dirs\n\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 os.path.isabs(path):\n        absprefix = os.path.abspath(prefix)\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(prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n    \"\"\" Generate <package>/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 scipy.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:\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<name>[\\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 = build_info.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    scipy_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 (<datadir suffix>,<path to data directory>)\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 (<datadir prefix>,<path to data file(s)>)\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 (<includedir suffix>,<path to header file(s)>)\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 scipy.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 scipy.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<revision>\\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        self.add_data_files(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_scipy_include_dirs():\n    include_dirs = Configuration.scipy_include_dirs[:]\n    if not include_dirs:\n        import scipy.base as base\n        include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n        #from distutils.sysconfig import get_python_inc\n        #prefix = []\n        #for name in scipy.__file__.split(os.sep):\n        #    if name=='lib':\n        #        break\n        #    prefix.append(name)\n        #include_dirs.append(get_python_inc(prefix=os.sep.join(prefix)))\n    return include_dirs\n\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 os.path.isabs(path):\n        absprefix = os.path.abspath(prefix)\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(prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n    \"\"\" Generate <package>/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 scipy.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": 129,
                        "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": 108,
                        "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_scipy_include_dirs",
                        "long_name": "get_scipy_include_dirs( )",
                        "filename": "misc_util.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [],
                        "start_line": 863,
                        "end_line": 875,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 879,
                        "end_line": 884,
                        "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": 13,
                        "complexity": 5,
                        "token_count": 157,
                        "parameters": [
                            "prefix",
                            "path"
                        ],
                        "start_line": 886,
                        "end_line": 899,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "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": 901,
                        "end_line": 937,
                        "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": 939,
                        "end_line": 966,
                        "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": 129,
                        "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": 108,
                        "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": 7,
                        "complexity": 2,
                        "token_count": 42,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 809,
                        "end_line": 841,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "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": 843,
                        "end_line": 848,
                        "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": 850,
                        "end_line": 860,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 11,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "get_scipy_include_dirs",
                        "long_name": "get_scipy_include_dirs( )",
                        "filename": "misc_util.py",
                        "nloc": 6,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [],
                        "start_line": 862,
                        "end_line": 874,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "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": 878,
                        "end_line": 883,
                        "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": 13,
                        "complexity": 5,
                        "token_count": 157,
                        "parameters": [
                            "prefix",
                            "path"
                        ],
                        "start_line": 885,
                        "end_line": 898,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 14,
                        "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": 900,
                        "end_line": 936,
                        "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": 938,
                        "end_line": 965,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "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
                    }
                ],
                "nloc": 719,
                "complexity": 228,
                "token_count": 5318,
                "diff_parsed": {
                    "added": [
                        "        d = os.path.join(*(self.name.split('.')))",
                        "        self.add_data_files((d,generate_svn_version_py()))"
                    ],
                    "deleted": [
                        "        self.add_data_files(generate_svn_version_py())"
                    ]
                }
            }
        ]
    },
    {
        "hash": "58dbd7af7f7643edeecb474cdaed6eb07b3d7847",
        "msg": "Doc updates and initial hooks for scipy imports.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T13:15:00+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T13:15:00+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "464b5d560efb3ef231605b7da7b9e9d133a1565d"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 5,
        "insertions": 27,
        "lines": 32,
        "files": 1,
        "dmm_unit_size": null,
        "dmm_unit_complexity": null,
        "dmm_unit_interfacing": null,
        "modified_files": [
            {
                "old_path": "scipy/__init__.py",
                "new_path": "scipy/__init__.py",
                "filename": "__init__.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,13 +1,19 @@\n-\"\"\"SciPy Core\n+\"\"\"\\\n+SciPy Core\n+==========\n \n-You can support the development of SciPy by purchasing documentation at\n+You can support the development of SciPy by purchasing documentation\n+at\n \n-http://www.trelgol.com\n+  http://www.trelgol.com\n \n-It is being distributed for a fee for a limited time to try and raise money for\n-development.\n+It is being distributed for a fee for a limited time to try and raise\n+money for development.\n \n Documentation is also available in the docstrings.\n+\n+Available subpackages\n+---------------------\n \"\"\"\n \n try:\n@@ -28,3 +34,19 @@\n     from core_version import version as __core_version__\n     from scipy.test.testing import ScipyTest\n     test = ScipyTest('scipy').test\n+\n+__scipy_doc__ = \"\"\"\\\n+SciPy: A scientific computing package for Python\n+================================================\n+\n+Available subpackages\n+---------------------\n+\"\"\"\n+\n+try:\n+    from __scipy_config__ import show as show_scipy_config\n+except ImportError:\n+    show_scipy_config = None\n+\n+if show_scipy_config is not None:\n+    __doc__ += __scipy_doc__\n",
                "added_lines": 27,
                "deleted_lines": 5,
                "source_code": "\"\"\"\\\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\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n\n__scipy_doc__ = \"\"\"\\\nSciPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\ntry:\n    from __scipy_config__ import show as show_scipy_config\nexcept ImportError:\n    show_scipy_config = None\n\nif show_scipy_config is not None:\n    __doc__ += __scipy_doc__\n",
                "source_code_before": "\"\"\"SciPy Core\n\nYou can support the development of SciPy by purchasing documentation at\n\nhttp://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise money for\ndevelopment.\n\nDocumentation is also available in the docstrings.\n\"\"\"\n\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 47,
                "complexity": 0,
                "token_count": 128,
                "diff_parsed": {
                    "added": [
                        "\"\"\"\\",
                        "SciPy Core",
                        "==========",
                        "You can support the development of SciPy by purchasing documentation",
                        "at",
                        "  http://www.trelgol.com",
                        "It is being distributed for a fee for a limited time to try and raise",
                        "money for development.",
                        "",
                        "Available subpackages",
                        "---------------------",
                        "",
                        "__scipy_doc__ = \"\"\"\\",
                        "SciPy: A scientific computing package for Python",
                        "================================================",
                        "",
                        "Available subpackages",
                        "---------------------",
                        "\"\"\"",
                        "",
                        "try:",
                        "    from __scipy_config__ import show as show_scipy_config",
                        "except ImportError:",
                        "    show_scipy_config = None",
                        "",
                        "if show_scipy_config is not None:",
                        "    __doc__ += __scipy_doc__"
                    ],
                    "deleted": [
                        "\"\"\"SciPy Core",
                        "You can support the development of SciPy by purchasing documentation at",
                        "http://www.trelgol.com",
                        "It is being distributed for a fee for a limited time to try and raise money for",
                        "development."
                    ]
                }
            }
        ]
    },
    {
        "hash": "f56b5b052b4d7f2ea72699dcd0ee558d3cc9bbd4",
        "msg": "Initial hooks for package imports.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T15:31:13+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T15:31:13+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "58dbd7af7f7643edeecb474cdaed6eb07b3d7847"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 3,
        "insertions": 29,
        "lines": 32,
        "files": 2,
        "dmm_unit_size": 1.0,
        "dmm_unit_complexity": 1.0,
        "dmm_unit_interfacing": 1.0,
        "modified_files": [
            {
                "old_path": "scipy/__init__.py",
                "new_path": "scipy/__init__.py",
                "filename": "__init__.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -43,10 +43,18 @@\n ---------------------\n \"\"\"\n \n-try:\n-    from __scipy_config__ import show as show_scipy_config\n-except ImportError:\n+import os\n+if os.environ.has_key('RUNNING_FROM_SCIPY_SOURCE'):\n+    print 'Running from scipy source directory.'\n     show_scipy_config = None\n+else:\n+    try:\n+        from __scipy_config__ import show as show_scipy_config\n+    except ImportError:\n+        show_scipy_config = None\n+\n \n if show_scipy_config is not None:\n     __doc__ += __scipy_doc__\n+    from _import_tools import import_packages\n+    import_packages(__path__[0])\n",
                "added_lines": 11,
                "deleted_lines": 3,
                "source_code": "\"\"\"\\\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\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n\n__scipy_doc__ = \"\"\"\\\nSciPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os\nif os.environ.has_key('RUNNING_FROM_SCIPY_SOURCE'):\n    print 'Running from scipy source directory.'\n    show_scipy_config = None\nelse:\n    try:\n        from __scipy_config__ import show as show_scipy_config\n    except ImportError:\n        show_scipy_config = None\n\n\nif show_scipy_config is not None:\n    __doc__ += __scipy_doc__\n    from _import_tools import import_packages\n    import_packages(__path__[0])\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\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n\n__scipy_doc__ = \"\"\"\\\nSciPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\ntry:\n    from __scipy_config__ import show as show_scipy_config\nexcept ImportError:\n    show_scipy_config = None\n\nif show_scipy_config is not None:\n    __doc__ += __scipy_doc__\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 54,
                "complexity": 0,
                "token_count": 158,
                "diff_parsed": {
                    "added": [
                        "import os",
                        "if os.environ.has_key('RUNNING_FROM_SCIPY_SOURCE'):",
                        "    print 'Running from scipy source directory.'",
                        "else:",
                        "    try:",
                        "        from __scipy_config__ import show as show_scipy_config",
                        "    except ImportError:",
                        "        show_scipy_config = None",
                        "",
                        "    from _import_tools import import_packages",
                        "    import_packages(__path__[0])"
                    ],
                    "deleted": [
                        "try:",
                        "    from __scipy_config__ import show as show_scipy_config",
                        "except ImportError:"
                    ]
                }
            },
            {
                "old_path": null,
                "new_path": "scipy/_import_tools.py",
                "filename": "_import_tools.py",
                "extension": "py",
                "change_type": "ADD",
                "diff": "@@ -0,0 +1,18 @@\n+\n+import os\n+import imp\n+from glob import glob\n+\n+def import_packages(rootpath):\n+    \"\"\" Import packages in the current directory that implement\n+    info.py. See DEVELOPERS.txt for more info.\n+    \"\"\"\n+    for info_file in glob(os.path.join(rootpath,'*','info.py')):\n+         package_name = os.path.basename(os.path.dirname(info_file))\n+         print info_file,package_name\n+         continue\n+         try:\n+             info_module = imp.load_module()\n+         except Exception,msg:\n+             print msg\n+             info_module = None\n",
                "added_lines": 18,
                "deleted_lines": 0,
                "source_code": "\nimport os\nimport imp\nfrom glob import glob\n\ndef import_packages(rootpath):\n    \"\"\" Import packages in the current directory that implement\n    info.py. See DEVELOPERS.txt for more info.\n    \"\"\"\n    for info_file in glob(os.path.join(rootpath,'*','info.py')):\n         package_name = os.path.basename(os.path.dirname(info_file))\n         print info_file,package_name\n         continue\n         try:\n             info_module = imp.load_module()\n         except Exception,msg:\n             print msg\n             info_module = None\n",
                "source_code_before": null,
                "methods": [
                    {
                        "name": "import_packages",
                        "long_name": "import_packages( rootpath )",
                        "filename": "_import_tools.py",
                        "nloc": 10,
                        "complexity": 3,
                        "token_count": 66,
                        "parameters": [
                            "rootpath"
                        ],
                        "start_line": 6,
                        "end_line": 18,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [],
                "changed_methods": [
                    {
                        "name": "import_packages",
                        "long_name": "import_packages( rootpath )",
                        "filename": "_import_tools.py",
                        "nloc": 10,
                        "complexity": 3,
                        "token_count": 66,
                        "parameters": [
                            "rootpath"
                        ],
                        "start_line": 6,
                        "end_line": 18,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 13,
                "complexity": 3,
                "token_count": 75,
                "diff_parsed": {
                    "added": [
                        "",
                        "import os",
                        "import imp",
                        "from glob import glob",
                        "",
                        "def import_packages(rootpath):",
                        "    \"\"\" Import packages in the current directory that implement",
                        "    info.py. See DEVELOPERS.txt for more info.",
                        "    \"\"\"",
                        "    for info_file in glob(os.path.join(rootpath,'*','info.py')):",
                        "         package_name = os.path.basename(os.path.dirname(info_file))",
                        "         print info_file,package_name",
                        "         continue",
                        "         try:",
                        "             info_module = imp.load_module()",
                        "         except Exception,msg:",
                        "             print msg",
                        "             info_module = None"
                    ],
                    "deleted": []
                }
            }
        ]
    },
    {
        "hash": "fb62ac9712cec1b8ca9cf5e9326efa94c3918286",
        "msg": "Cleaned up a few things in arrayobject.h",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-14T17:30:17+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T17:30:17+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "f56b5b052b4d7f2ea72699dcd0ee558d3cc9bbd4"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 9,
        "insertions": 5,
        "lines": 14,
        "files": 1,
        "dmm_unit_size": null,
        "dmm_unit_complexity": null,
        "dmm_unit_interfacing": null,
        "modified_files": [
            {
                "old_path": "scipy/base/include/scipy/arrayobject.h",
                "new_path": "scipy/base/include/scipy/arrayobject.h",
                "filename": "arrayobject.h",
                "extension": "h",
                "change_type": "MODIFY",
                "diff": "@@ -162,8 +162,6 @@ enum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n \n \t/* Define bit-width array types and typedefs */\n \n-#define MAKEFLOAT(x) x.\n-\n #define MAX_INT8 127\n #define MIN_INT8 -128\n #define MAX_UINT8 255\n@@ -641,7 +639,7 @@ enum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n typedef Py_intptr_t intp;\n typedef Py_uintptr_t uintp;\n \n-#define INTP_STRFORMAT \"%d\"\n+#define INTP_FMT \"%d\"\n \n #if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n \t#define PyArray_INTP PyArray_INT\n@@ -667,8 +665,8 @@ typedef Py_uintptr_t uintp;\n \t#define MAX_INTP MAX_LONGLONG\n \t#define MIN_INTP MIN_LONGLONG\n \t#define MAX_UINTP MAX_ULONGLONG\n-        #undef INTP_STRFORMAT\n-        #define INTP_STRFORMAT \"%Ld\"\n+        #undef INTP_FMT\n+        #define INTP_FMT \"%Ld\"\n #endif\n \n #define ERR(str) fprintf(stderr, #str); fflush(stderr);\n@@ -839,9 +837,7 @@ typedef struct {\n /* Size of internal buffers used for alignment */\n #define PyArray_BUFSIZE 10000\n #define PyArray_MIN_BUFSIZE 5\n-#define PyArray_MAX_BUFSIZE MAX_INT32\n-#define MAXBUFNUM 1024\n-\n+#define PyArray_MAX_BUFSIZE 100000000\n \n #define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n #define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n@@ -1113,7 +1109,7 @@ typedef struct {\n #define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n #define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n #define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n-#define PyArray_ISPYTHONTYPE(obj) PyTypeNum_ISPYTHONTYPE(PyArray_TYPE(obj))\n+#define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj))\n #define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n #define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n #define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n",
                "added_lines": 5,
                "deleted_lines": 9,
                "source_code": "\n/* This expects the following variables to be defined (besides\n   the usual ones from pyconfig.h\n\n   SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no\n                         long double is present on platform.\n   CHAR_BIT       --     number of bits in a char (usually 8)\n                         (should be in limits.h)\n*/\n\n#ifndef Py_ARRAYOBJECT_H\n#define Py_ARRAYOBJECT_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"config.h\"\n\n/* There are several places in the code where an array of dimensions is */\n/* allocated statically.  This is the size of that static allocation. */\n\n#define MAX_DIMS 40\n\n/* Used for Converter Functions \"O&\" code in ParseTuple */\n#define PY_FAIL 0\n#define PY_SUCCEED 1\n\n#define NDARRAY_VERSION 0x0400\n\n\t/* Some platforms don't define bool, long long, or long double.\n\t   Handle that here.\n\t */\n\n#ifdef PY_LONG_LONG\ntypedef PY_LONG_LONG longlong;\ntypedef unsigned PY_LONG_LONG ulonglong;\n#  ifdef _MSC_VER\n#    define LONGLONG_FMT         \"%I64d\"\n#    define ULONGLONG_FMT        \"%I64u\"\n#    define LONGLONG_SUFFIX(x)   (x##i64)\n#    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n#  else\n\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant\n           #define ULONGLONG_FMT  \"%llu\"\n\n\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?\n\t   #define ULONGLONG_FMT   \"%qu\"\n\t*/\n#    define LONGLONG_FMT         \"%Ld\"\n#    define ULONGLONG_FMT        \"%Lu\"\n#    define LONGLONG_SUFFIX(x)   (x##LL)\n#    define ULONGLONG_SUFFIX(x)  (x##ULL)\n#  endif\n#else\ntypedef long longlong;\ntypedef unsigned long ulonglong;\n#  define LONGLONG_SUFFIX(x)  (x##L)\n#  define ULONGLONG_SUFFIX(x) (x##UL)\n#endif\n\ntypedef unsigned char Bool;\n#ifndef FALSE\n#define FALSE 0\n#endif\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE\n\ttypedef double longdouble;\n        #define LONGDOUBLE_FMT \"g\"\n#else\n\ttypedef long double longdouble;\n        #define LONGDOUBLE_FMT \"Lg\"\n#endif\n\n#ifndef Py_USING_UNICODE\n#define Py_UNICODE char\n#endif\n\n\ntypedef signed char byte;\ntypedef unsigned char ubyte;\ntypedef unsigned short ushort;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\n\ntypedef struct { float real, imag; } cfloat;\ntypedef struct { double real, imag; } cdouble;\ntypedef struct {longdouble real, imag;} clongdouble;\n\nenum PyArray_TYPES {    PyArray_BOOL=0,\n                        PyArray_BYTE, PyArray_UBYTE,\n\t\t        PyArray_SHORT, PyArray_USHORT,\n\t\t        PyArray_INT, PyArray_UINT,\n\t\t\tPyArray_LONG, PyArray_ULONG,\n                        PyArray_LONGLONG, PyArray_ULONGLONG,\n\t\t\tPyArray_FLOAT, PyArray_DOUBLE, PyArray_LONGDOUBLE,\n\t\t\tPyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CLONGDOUBLE,\n\t\t\tPyArray_OBJECT=17,\n                        PyArray_STRING, PyArray_UNICODE,\n\t\t\tPyArray_VOID,\n\t\t\tPyArray_NTYPES,\n\t\t\tPyArray_NOTYPE,\n\t\t\tPyArray_USERDEF=256  /* leave room for characters */\n};\n\n\t/* basetype array priority */\n#define PyArray_PRIORITY 0.0\n#define PyArray_BIG_PRIORITY 0.1\n\t/* default subtype priority */\n#define PyArray_SUBTYPE_PRIORITY 1.0\n\n\t/* How many floating point types are there */\n#define PyArray_NUM_FLOATTYPE 3\n\n\n\t/* We need to match intp to a signed integer of the same size as\n\t   a pointer variable. uintp to the equivalent unsigned integer\n\t*/\n\n\n\t/* These characters correspond to the array type and the\n\t   struct module */\n\n\t/*  except 'p' -- signed integer for pointer type */\n\nenum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n\t\t\tPyArray_BYTELTR = 'b',\n\t\t\tPyArray_UBYTELTR = 'B',\n\t\t\tPyArray_SHORTLTR = 'h',\n\t\t\tPyArray_USHORTLTR = 'H',\n\t\t\tPyArray_INTLTR = 'i',\n\t\t\tPyArray_UINTLTR = 'I',\n\t\t\tPyArray_LONGLTR = 'l',\n\t\t\tPyArray_ULONGLTR = 'L',  \n\t\t\tPyArray_LONGLONGLTR = 'q',   \n\t\t\tPyArray_ULONGLONGLTR = 'Q',\n\t\t\tPyArray_FLOATLTR = 'f',\n\t\t\tPyArray_DOUBLELTR = 'd',\n\t\t\tPyArray_LONGDOUBLELTR = 'g',\n\t\t\tPyArray_CFLOATLTR = 'F',\n\t\t\tPyArray_CDOUBLELTR = 'D',\n\t\t\tPyArray_CLONGDOUBLELTR = 'G',\n\t\t\tPyArray_OBJECTLTR = 'O',\n\t\t\tPyArray_STRINGLTR = 'S',\n\t\t\tPyArray_UNICODELTR = 'U',\n\t\t        PyArray_VOIDLTR = 'V',\n\n\t\t\t/* No Descriptor, just a define -- this let's\n\t\t\t Python users specify an array of integers\n\t\t\t large enough to hold a pointer on the platform*/\n\t\t\tPyArray_INTPLTR = 'p',\n\t\t\tPyArray_UINTPLTR = 'P',\n\n\t\t\tPyArray_GENBOOLLTR ='b',\n\t\t\tPyArray_SIGNEDLTR = 'i',\n\t\t\tPyArray_UNSIGNEDLTR = 'u',\n\t\t\tPyArray_FLOATINGLTR = 'f',\n\t\t\tPyArray_COMPLEXLTR = 'c'\n};\n\n\t/* Define bit-width array types and typedefs */\n\n#define MAX_INT8 127\n#define MIN_INT8 -128\n#define MAX_UINT8 255\n#define MAX_INT16 32767\n#define MIN_INT16 -32768\n#define MAX_UINT16 65535\n#define MAX_INT32 2147483647\n#define MIN_INT32 (-MAX_INT32 - 1)\n#define MAX_UINT32 4294967295U\n#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)\n#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))\n#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)\n#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)\n#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))\n#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)\n#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)\n#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))\n#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\n\t/* Need to find the number of bits for each type and \n\t   make definitions accordingly. \n\n\t   C states that sizeof(char) == 1 by definition \n\t   \n\t   So, just using the sizeof keyword won't help.  \n\n\t   It also looks like Python itself uses sizeof(char) quite a\n\t   bit, which by definition should be 1 all the time.\n\n\t   Idea: Make Use of CHAR_BIT which should tell us how many\n\t   BITS per CHARACTER\n\t*/\n\n\t/* Include platform definitions -- These are in the C89/90 standard */\n#include <limits.h>  \n#define MAX_BYTE SCHAR_MAX\n#define MIN_BYTE SCHAR_MIN\n#define MAX_UBYTE UCHAR_MAX\n#define MAX_SHORT SHRT_MAX\n#define MIN_SHORT SHRT_MIN\n#define MAX_USHORT USHRT_MAX\n#define MAX_INT   INT_MAX\n#ifndef INT_MIN\n#define INT_MIN (-INT_MAX - 1)\n#endif\n#define MIN_INT   INT_MIN\n#define MAX_UINT  UINT_MAX\n#define MAX_LONG  LONG_MAX\n#define MIN_LONG  LONG_MIN\n#define MAX_ULONG  ULONG_MAX\n\n#define SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE\n#define SIZEOF_LONGLONG SIZEOF_LONG_LONG\n#define BITSOF_BOOL sizeof(Bool)*CHAR_BIT\n#define BITSOF_CHAR CHAR_BIT\n#define BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)\n#define BITSOF_INT (SIZEOF_INT*CHAR_BIT)\n#define BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)\n#define BITSOF_LONGLONG (SIZEOF_LONGLONG*CHAR_BIT)\n#define BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)\n#define BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)\n#define BITSOF_LONGDOUBLE (SIZEOF_LONGDOUBLE*CHAR_BIT)\n\n\n#if BITSOF_LONG == 8\n#define PyArray_INT8 PyArray_LONG\n#define PyArray_UINT8 PyArray_ULONG\n\ttypedef long Int8;\n\ttypedef unsigned long UInt8;\n#define STRBITSOF_LONG \"8\"\n#elif BITSOF_LONG == 16\n#define PyArray_INT16 PyArray_LONG\n#define PyArray_UINT16 PyArray_ULONG\n\ttypedef long Int16;\n\ttypedef unsigned long UInt16;\n#define STRBITSOF_LONG \"16\"\n#elif BITSOF_LONG == 32\n#define PyArray_INT32 PyArray_LONG\n#define PyArray_UINT32 PyArray_ULONG\n\ttypedef long Int32;\n\ttypedef unsigned long UInt32;\n#define STRBITSOF_LONG \"32\"\n#elif BITSOF_LONG == 64\n#define PyArray_INT64 PyArray_LONG\n#define PyArray_UINT64 PyArray_ULONG\n\ttypedef long Int64;\n\ttypedef unsigned long UInt64;\n#define STRBITSOF_LONG \"64\"\n#elif BITSOF_LONG == 128\n#define PyArray_INT128 PyArray_LONG\n#define PyArray_UINT128 PyArray_ULONG\n\ttypedef long Int128;\n\ttypedef unsigned long UInt128;\n#define STRBITSOF_LONG \"128\"\n#endif\n\n#if BITSOF_LONGLONG == 8\n#  ifndef PyArray_INT8\n#    define PyArray_INT8 PyArray_LONGLONG\n#    define PyArray_UINT8 PyArray_ULONGLONG\n\ttypedef longlong Int8;\n\ttypedef ulonglong UInt8;\n#  endif\n#  define MAX_LONGLONG MAX_INT8\n#  define MIN_LONGLONG MIN_INT8\n#  define MAX_ULONGLONG MAX_UINT8\n#define STRBITSOF_LONGLONG \"8\"\n#elif BITSOF_LONGLONG == 16\n#  ifndef PyArray_INT16\n#    define PyArray_INT16 PyArray_LONGLONG\n#    define PyArray_UINT16 PyArray_ULONGLONG\n\ttypedef longlong Int16;\n\ttypedef ulonglong UInt16;\n#  endif\n#  define MAX_LONGLONG MAX_INT16\n#  define MIN_LONGLONG MIN_INT16\n#  define MAX_ULONGLONG MAX_UINT16\n#define STRBITSOF_LONGLONG \"16\"\n#elif BITSOF_LONGLONG == 32\n#  ifndef PyArray_INT32\n#    define PyArray_INT32 PyArray_LONGLONG\n#    define PyArray_UINT32 PyArray_ULONGLONG\n\ttypedef longlong Int32;\n\ttypedef ulonglong UInt32;\n#  endif\n#  define MAX_LONGLONG MAX_INT32\n#  define MIN_LONGLONG MIN_INT32\n#  define MAX_ULONGLONG MAX_UINT32\n#define STRBITSOF_LONGLONG \"32\"\n#elif BITSOF_LONGLONG == 64\n#  ifndef PyArray_INT64\n#    define PyArray_INT64 PyArray_LONGLONG\n#    define PyArray_UINT64 PyArray_ULONGLONG\n\ttypedef longlong Int64;\n\ttypedef ulonglong UInt64;\n#  endif\n#  define MAX_LONGLONG MAX_INT64\n#  define MIN_LONGLONG MIN_INT64\n#  define MAX_ULONGLONG MAX_UINT64\n#define STRBITSOF_LONGLONG \"64\"\n#elif BITSOF_LONGLONG == 128\n#  ifndef PyArray_INT128\n#    define PyArray_INT128 PyArray_LONGLONG\n#    define PyArray_UINT128 PyArray_ULONGLONG\n\ttypedef longlong Int128;\n\ttypedef ulonglong UInt128;\n#  endif\n#  define MAX_LONGLONG MAX_INT128\n#  define MIN_LONGLONG MIN_INT128\n#  define MAX_ULONGLONG MAX_UINT128\n#define STRBITSOF_LONGLONG \"128\"\n#elif BITSOF_LONGLONG == 256\n#  define PyArray_INT256 PyArray_LONGLONG\n#  define PyArray_UINT256 PyArray_ULONGLONG\n\ttypedef longlong Int256;\n\ttypedef ulonglong UInt256;\n#  define MAX_LONGLONG MAX_INT256\n#  define MIN_LONGLONG MIN_INT256\n#  define MAX_ULONGLONG MAX_UINT256\n#define STRBITSOF_LONGLONG \"256\"\n#endif\n\n#if BITSOF_INT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_INT\n#define PyArray_UINT8 PyArray_UINT\n\ttypedef int Int8;\n\ttypedef unsigned int UInt8;\n#endif\n#define STRBITSOF_INT \"8\"\n#elif BITSOF_INT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_INT\n#define PyArray_UINT16 PyArray_UINT\n\ttypedef int Int16;\n\ttypedef unsigned int UInt16;\n#endif\n#define STRBITSOF_INT \"16\"\n#elif BITSOF_INT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_INT\n#define PyArray_UINT32 PyArray_UINT\n\ttypedef int Int32;\n\ttypedef unsigned int UInt32;\n#endif\n#define STRBITSOF_INT \"32\"\n#elif BITSOF_INT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_INT\n#define PyArray_UINT64 PyArray_UINT\n\ttypedef int Int64;\n\ttypedef unsigned int UInt64;\n#endif\n#define STRBITSOF_INT \"64\"\n#elif BITSOF_INT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_INT\n#define PyArray_UINT128 PyArray_UINT\n\ttypedef int Int128;\n\ttypedef unsigned int UInt128;\n#endif\n#define STRBITSOF_INT \"128\"\n#endif\n\n#if BITSOF_SHORT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_SHORT\n#define PyArray_UINT8 PyArray_USHORT\n\ttypedef short Int8;\n\ttypedef unsigned short UInt8;\n#endif\n#define STRBITSOF_SHORT \"8\"\n#elif BITSOF_SHORT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_SHORT\n#define PyArray_UINT16 PyArray_USHORT\n\ttypedef short Int16;\n\ttypedef unsigned short UInt16;\n#endif\n#define STRBITSOF_SHORT \"16\"\n#elif BITSOF_SHORT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_SHORT\n#define PyArray_UINT32 PyArray_USHORT\n\ttypedef short Int32;\n\ttypedef unsigned short UInt32;\n#endif\n#define STRBITSOF_SHORT \"32\"\n#elif BITSOF_SHORT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_SHORT\n#define PyArray_UINT64 PyArray_USHORT\n\ttypedef short Int64;\n\ttypedef unsigned short UInt64;\n#endif\n#define STRBITSOF_SHORT \"64\"\n#elif BITSOF_SHORT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_SHORT\n#define PyArray_UINT128 PyArray_USHORT\n\ttypedef short Int128;\n\ttypedef unsigned short UInt128;\n#endif\n#define STRBITSOF_SHORT \"128\"\n#endif\n\n\n#if BITSOF_CHAR == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_BYTE\n#define PyArray_UINT8 PyArray_UBYTE\n\ttypedef signed char Int8;\n\ttypedef unsigned char UInt8;\n#endif\n#define STRBITSOF_CHAR \"8\"\n#elif BITSOF_CHAR == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_BYTE\n#define PyArray_UINT16 PyArray_UBYTE\n\ttypedef signed char Int16;\n\ttypedef unsigned char UInt16;\n#endif\n#define STRBITSOF_CHAR \"16\"\n#elif BITSOF_CHAR == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_BYTE\n#define PyArray_UINT32 PyArray_UBYTE\n\ttypedef signed char Int32;\n\ttypedef unsigned char UInt32;\n#endif\n#define STRBITSOF_CHAR \"32\"\n#elif BITSOF_CHAR == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_BYTE\n#define PyArray_UINT64 PyArray_UBYTE\n\ttypedef signed char Int64;\n\ttypedef unsigned char UInt64;\n#endif\n#define STRBITSOF_CHAR \"64\"\n#elif BITSOF_CHAR == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_BYTE\n#define PyArray_UINT128 PyArray_UBYTE\n\ttypedef signed char Int128;\n\ttypedef unsigned char UInt128;\n#endif\n#define STRBITSOF_CHAR \"128\"\n#endif\n\n\n\n#if BITSOF_DOUBLE == 16\n#define STRBITSOF_DOUBLE \"16\"\n#define STRBITSOF_CDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_DOUBLE\n#define PyArray_COMPLEX32 PyArray_CDOUBLE\n\ttypedef  double Float16;\n\ttypedef cdouble Complex32;\n#endif\n#elif BITSOF_DOUBLE == 32\n#define STRBITSOF_DOUBLE \"32\"\n#define STRBITSOF_CDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_DOUBLE\n#define PyArray_COMPLEX64 PyArray_CDOUBLE\n\ttypedef double Float32;\n\ttypedef cdouble Complex64;\n#endif\n#elif BITSOF_DOUBLE == 64\n#define STRBITSOF_DOUBLE \"64\"\n#define STRBITSOF_CDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_DOUBLE\n#define PyArray_COMPLEX128 PyArray_CDOUBLE\n\ttypedef double Float64;\n\ttypedef cdouble Complex128;\n#endif\n#elif BITSOF_DOUBLE == 80\n#define STRBITSOF_DOUBLE \"80\"\n#define STRBITSOF_CDOUBLE \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_DOUBLE\n#define PyArray_COMPLEX160 PyArray_CDOUBLE\n\ttypedef double Float80\n\ttypedef cdouble Complex160\n#endif\n#elif BITSOF_DOUBLE == 96\n#define STRBITSOF_DOUBLE \"96\"\n#define STRBITSOF_CDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_DOUBLE\n#define PyArray_COMPLEX192 PyArray_CDOUBLE\n\ttypedef double Float96;\n\ttypedef cdouble Complex192;\n#endif\n#elif BITSOF_DOUBLE == 128\n#define STRBITSOF_DOUBLE \"128\"\n#define STRBITSOF_CDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_DOUBLE\n#define PyArray_COMPLEX256 PyArray_CDOUBLE\n\ttypedef double Float128;\n\ttypedef cdouble Complex256;\n#endif\n#endif\n\n\n\n#if BITSOF_FLOAT == 16\n#define STRBITSOF_FLOAT \"16\"\n#define STRBITSOF_CFLOAT \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_FLOAT\n#define PyArray_COMPLEX32 PyArray_CFLOAT\n\ttypedef float Float16;\n\ttypedef cfloat Complex32;\n#endif\n#elif BITSOF_FLOAT == 32\n#define STRBITSOF_FLOAT \"32\"\n#define STRBITSOF_CFLOAT \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_FLOAT\n#define PyArray_COMPLEX64 PyArray_CFLOAT\n\ttypedef float Float32;\n\ttypedef cfloat Complex64;\n#endif\n#elif BITSOF_FLOAT == 64\n#define STRBITSOF_FLOAT \"64\"\n#define STRBITSOF_CFLOAT \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_FLOAT\n#define PyArray_COMPLEX128 PyArray_CFLOAT\n\ttypedef float Float64;\n\ttypedef cfloat Complex128;\n#endif\n#elif BITSOF_FLOAT == 80\n#define STRBITSOF_FLOAT \"80\"\n#define STRBITSOF_CFLOAT \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_FLOAT\n#define PyArray_COMPLEX160 PyArray_CFLOAT\n\ttypedef float Float80\n\ttypedef cfloat Complex160\n#endif\n#elif BITSOF_FLOAT == 96\n#define STRBITSOF_FLOAT \"96\"\n#define STRBITSOF_CFLOAT \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_FLOAT\n#define PyArray_COMPLEX192 PyArray_CFLOAT\n\ttypedef float Float96;\n\ttypedef cfloat Complex192;\n#endif\n#elif BITSOF_FLOAT == 128\n#define STRBITSOF_FLOAT \"128\"\n#define STRBITSOF_CFLOAT \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_FLOAT\n#define PyArray_COMPLEX256 PyArray_CFLOAT\n\ttypedef float Float128;\n\ttypedef cfloat Complex256;\n#endif\n#endif\n\n\n#if BITSOF_LONGDOUBLE == 16\n#define STRBITSOF_LONGDOUBLE \"16\"\n#define STRBITSOF_CLONGDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX32 PyArray_CLONGDOUBLE\n\ttypedef  longdouble Float16;\n\ttypedef clongdouble Complex32;\n#endif\n#elif BITSOF_LONGDOUBLE == 32\n#define STRBITSOF_LONGDOUBLE \"32\"\n#define STRBITSOF_CLONGDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX64 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float32;\n\ttypedef clongdouble Complex64;\n#endif\n#elif BITSOF_LONGDOUBLE == 64\n#define STRBITSOF_LONGDOUBLE \"64\"\n#define STRBITSOF_CLONGDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX128 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float64;\n\ttypedef clongdouble Complex128;\n#endif\n#elif BITSOF_LONGDOUBLE == 80\n#define STRBITSOF_LONGDOUBLE \"80\"\n#define STRBITSOF_CLONGDOUBLE \"160\" \n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX160 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float80\n\ttypedef clongdouble Complex160\n#endif\n#elif BITSOF_LONGDOUBLE == 96\n#define STRBITSOF_LONGDOUBLE \"96\"\n#define STRBITSOF_CLONGDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX192 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float96;\n\ttypedef clongdouble Complex192;\n#endif\n#elif BITSOF_LONGDOUBLE == 128\n#define STRBITSOF_LONGDOUBLE \"128\"\n#define STRBITSOF_CLONGDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX256 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float128;\n\ttypedef clongdouble Complex256;\n#endif\n#elif BITSOF_LONGDOUBLE == 256\n#define STRBITSOF_LONGDOUBLE \"256\"\n#define STRBITSOF_CLONGDOUBLE \"512\"\n#define PyArray_FLOAT256 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX512 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float256;\n\ttypedef clongdouble Complex512;\n#endif\n\n\n\t/* End of typedefs for numarray style bit-width names */\n\n/* This is to typedef Intp to the appropriate pointer size for this platform.\n * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */\ntypedef Py_intptr_t intp;\ntypedef Py_uintptr_t uintp;\n\n#define INTP_FMT \"%d\"\n\n#if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n\t#define PyArray_INTP PyArray_INT\n\t#define PyArray_UINTP PyArray_UINT\n        #define PyIntpArrType_Type PyIntArrType_Type\n        #define PyUIntpArrType_Type PyUIntArrType_Type\n\t#define MAX_INTP MAX_INT\n\t#define MIN_INTP MIN_INT\n\t#define MAX_UINTP MAX_UINT\n#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG\n\t#define PyArray_INTP PyArray_LONG\n\t#define PyArray_UINTP PyArray_ULONG\n        #define PyIntpArrType_Type PyLongArrType_Type\n        #define PyUIntpArrType_Type PyULongArrType_Type\n\t#define MAX_INTP MAX_LONG\n\t#define MIN_INTP MIN_LONG\n\t#define MAX_UINTP MAX_ULONG\n#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)\n\t#define PyArray_INTP PyArray_LONGLONG\n\t#define PyArray_UINTP PyArray_ULONGLONG\n        #define PyIntpArrType_Type PyLongLongArrType_Type\n        #define PyUIntpArrType_Type PyULongLongArrType_Type\n\t#define MAX_INTP MAX_LONGLONG\n\t#define MIN_INTP MIN_LONGLONG\n\t#define MAX_UINTP MAX_ULONGLONG\n        #undef INTP_FMT\n        #define INTP_FMT \"%Ld\"\n#endif\n\n#define ERR(str) fprintf(stderr, #str); fflush(stderr);\n#define ERR2(str) fprintf(stderr, str); fflush(stderr);\n\n  /* Macros to define how array, and dimension/strides data is\n     allocated. \n  */\n\n  /* Data buffer */\n#define PyDataMem_NEW(size) ((char *)malloc(size))\n  /* #define PyArrayMem_NEW(size) PyMem_NEW(char, size)*/\n#define PyDataMem_FREE(ptr)  free(ptr)\n  /* #define PyArrayMem_FREE(ptr) PyMem_Free(ptr) */\n#define PyDataMem_RENEW(ptr,size) ((char *)realloc(ptr,size))\n\n  /* Dimensions and strides */\n#define PyDimMem_NEW(size) ((intp *)malloc(size*sizeof(intp)))\n#define PyDimMem_FREE(ptr) free(ptr)\n#define PyDimMem_RENEW(ptr,size) ((intp *)realloc(ptr,size*sizeof(intp)))\n\n\n  /* These must deal with unaligned and unbyteswapped data if necessary */\ntypedef PyObject * (PyArray_GetItemFunc) (char *, void *);\ntypedef int (PyArray_SetItemFunc)(PyObject *, char *, void *);\n\ntypedef int (PyArray_CompareFunc)(const void *, const void *, void *);\ntypedef void (PyArray_CopySwapNFunc)(void *, void *, intp, int, int);\ntypedef void (PyArray_CopySwapFunc)(void *, void *, int, int);\ntypedef Bool (PyArray_NonzeroFunc)(void *, void *);\n\n\n  /* These assume aligned and byteswapped data -- a buffer will be\n      used before or contiguous data will be obtained\n  */\ntypedef int (PyArray_ArgFunc)(void*, intp, intp*, void *);\ntypedef void (PyArray_DotFunc)(char *, intp, char *, intp, char *, intp, \n\t\t\t       void *);\ntypedef void (PyArray_VectorUnaryFunc)(void *, void *, intp, void *, void *);\ntypedef int (PyArray_ScanFunc)(FILE *, void *, int, char *, void *);\n\n\ntypedef struct {\n \tPyTypeObject *typeobj;  /* the type object for this type */\n\tchar kind;              /* kind for this type */\n\tchar type;              /* character representing this type */\n\tint type_num;           /* number representing this type */\n\tint elsize;             /* element size for this type -- \n\t\t\t\t   or 0 if variable */\n       \tint alignment;          /* alignment needed for this type */\n\n\t/* Functions to cast to all other standard types*/\n\tPyArray_VectorUnaryFunc *cast[PyArray_NTYPES];\n\n\t/* Functions to get and set items with standard\n\t   Python types -- not array scalars */\n\tPyArray_GetItemFunc *getitem;\n\tPyArray_SetItemFunc *setitem;\n\n\t/* Function to compare items */\n\tPyArray_CompareFunc *compare;\n\n  \t/* Function to select largest */\n\tPyArray_ArgFunc *argmax;\n\n\t/* Function to compute dot product */\n\tPyArray_DotFunc\t*dotfunc;\t   \n\t\n\t/* Function to scan an ASCII file and \n\t   place a single value plus possible separator */\n\tPyArray_ScanFunc *scanfunc;\n\n\t/* Copy and/or swap data.  Memory areas may not overlap */\n\t/*  Use memmove first if they might */\n\tPyArray_CopySwapNFunc *copyswapn;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\t/* Function to determine if data is zero or not */\n\tPyArray_NonzeroFunc *nonzero;\n\n} PyArray_Descr;\n\n\ntypedef struct PyArrayObject {\n\tPyObject_HEAD\n\tchar *data;             /* pointer to raw data buffer */\n\tint nd;                 /* number of dimensions, also called ndim */ \n\tintp *dimensions;       /* size in each dimension */\n        intp *strides;          /* bytes to jump to get to the \n\t\t\t\t   next element in each dimension */\n\tPyObject *base;         /* This object should be decref'd\n\t\t\t\t   upon deletion of array */\n\t                        /* For views it points to the original array */\n\t                        /* For creation from buffer object it points \n\t\t\t\t   to an object that shold be decref'd on \n\t\t\t\t   deletion */\n\t                        /* For UPDATEIFCOPY flag this is an array \n\t\t\t\t   to-be-updated upon deletion of this one */\n\tPyArray_Descr *descr;   /* Pointer to type structure */\n\tint flags;              /* Flags describing array -- see below*/\n\tint itemsize;           /* needed for Flexible size arrays:\n                                   CHAR, UNICODE, and VOID arrays\n \t\t\t         */ \n\tPyObject *weakreflist;  /* For weakreferences */\n\n} PyArrayObject;\n\n#define fortran fortran_  /* For some compilers */\n\ntypedef struct {   /* Just the type_num and itemsize variables \n\t\t      for use in the TypeNum Converter function */\n\tint type_num;\n\tint itemsize;\n\tint fortran;  /* Set to 1 if fortran-defined strides is desired */\n} PyArray_Typecode;\n\ntypedef struct {\n        intp *ptr;\n        int len;\n} PyArray_Dims;\n\n\n/* Mirrors buffer object to ptr */\n\ntypedef struct {\n        PyObject_HEAD\n        PyObject *base;\n        void *ptr;\n        intp len;\n        int flags;        \n} PyArray_Chunk;\n\n/* Array flags */\n#define CONTIGUOUS     1      /* means c-style contiguous (last index\n\t\t\t       varies the fastest) data elements right\n\t\t\t      after each other. */\n\n\t                      /* All 0-d arrays are CONTIGUOUS and FORTRAN\n\t\t\t\t contiguous.  If a 1-d array is CONTIGUOUS\n\t\t\t\t it is also FORTRAN contiguous \n\t\t\t      */\n\n#define FORTRAN    2    /* set if array is a contiguous Fortran array */\n                       /*  first index varies the fastest in memory\n                           (strides array is reverse of C-contiguous\n\t\t\t           array)*/\n\n#define OWNDATA        4\n#define OWN_DATA       OWNDATA\n\n\t/* array never has these three set -- FromAny flags only */\n#define FORCECAST     0x010    \n#define ENSURECOPY    0x020\n#define ENSUREARRAY   0x040\n\n#define ALIGNED       0x100\n#define NOTSWAPPED    0x200\n#define WRITEABLE     0x400\n\n\n\t/* If this flags is set, then base contains a pointer to \n\t   an array of the same size that should be updated with the \n\t   current contents of this array when this array is deallocated\n\t*/\n#define UPDATEIFCOPY  0x1000\n\n\n/* Size of internal buffers used for alignment */\n#define PyArray_BUFSIZE 10000\n#define PyArray_MIN_BUFSIZE 5\n#define PyArray_MAX_BUFSIZE 100000000\n\n#define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n#define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n#define CARRAY_FLAGS CONTIGUOUS | BEHAVED_FLAGS\n#define FARRAY_FLAGS FORTRAN | BEHAVED_FLAGS\n#define DEFAULT_FLAGS CARRAY_FLAGS\n\n#define UPDATE_ALL_FLAGS CONTIGUOUS | FORTRAN | ALIGNED\n\n\n/*\n * C API:  consists of Macros and functions.  The MACROS are defined here. \n */\n\n\n#define PyArray_CHKFLAGS(m, FLAGS) \\\n\t((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))\n#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, CONTIGUOUS)\n#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, WRITEABLE)\n\n#define PyArray_ISCARRAY(m) PyArray_CHKFLAGS(m, CARRAY_FLAGS)\n#define PyArray_ISFARRAY(m) PyArray_CHKFLAGS(m, FARRAY_FLAGS)\n#define PyArray_ISBEHAVED(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS)\n#define PyArray_ISBEHAVED_RO(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS_RO)\n\n\n#ifndef MAX\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#endif\n#ifndef MIN\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#endif\n\n        /* Useful if a and b have to be evaluated.  */\n\n#define tMAX(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_>_y_ ? _x_ : _y_}\n#define tMIN(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_<_y_ ? _x_ : _y_}\n\n#if defined(ALLOW_THREADS)\n#define BEGIN_THREADS_DEF PyThreadState *_save;\n#define BEGIN_THREADS _save = PyEval_SaveThread();\n#define END_THREADS   PyEval_RestoreThread(_save);\n#define ALLOW_C_API_DEF  PyGILState_STATE __save__;\n#define ALLOW_C_API      __save__ = PyGILState_Ensure();\n#define DISABLE_C_API    PyGILState_Release(__save__);\n#else\n#define BEGIN_THREADS_DEF\n#define BEGIN_THREADS\n#define END_THREADS\n#define ALLOW_C_API_DEF\n#define\tALLOW_C_API    \n#define\tDISABLE_C_API  \n#endif\n\ntypedef struct {\n        PyObject_HEAD\n\tint                     nd_m1;            /* number of dimensions - 1 */\n        intp\t\t        index, size;\n\tintp                    coordinates[MAX_DIMS];/* N-dimensional loop */\n        intp                    dims_m1[MAX_DIMS];    /* ao->dimensions - 1 */\n\tintp                    strides[MAX_DIMS];    /* ao->strides or fake */\n\tintp                    backstrides[MAX_DIMS];/* how far to jump back */\n\tintp                    factors[MAX_DIMS];     /* shape factors */\n\tPyArrayObject           *ao;\n\tchar                    *dataptr;        /* pointer to current item*/\n        unsigned char           contiguous;\n} PyArrayIterObject;\n\n\n/* Iterator API */ \n#define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type)\n\t\n#define PyArray_ITER_RESET(it) {\t\t\t\t\t\\\n\tit->index = 0;\t\t\t\t\t\t        \\\n\tit->dataptr = it->ao->data;\t\t\t\t\t\\\n\tmemset(it->coordinates, 0, (it->nd_m1+1)*sizeof(intp));\t\t\\\n}\n\n\n#define PyArray_ITER_NEXT(it) {\t\t\t\t\\\n\tit->index++;\t\t\t\t\t\\\n\tif (it->contiguous)  it->dataptr += it->ao->itemsize;\t       \\\n\telse {\t\t\t\t\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_ >= 0; _i_--) {\t\t\\\n\t\t\tif (it->coordinates[_i_] <\t\t\t\\\n\t\t\t    it->dims_m1[_i_]) {\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_]++;\t\t\t\\\n\t\t\t\tit->dataptr += it->strides[_i_];\t\\\n\t\t\t\tbreak;\t\t\t\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t\telse {\t\t\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_] = 0;\t\t\\\n\t\t\t\tit->dataptr -= it->backstrides[_i_];\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n}\n\n#define PyArray_ITER_GOTO(it, destination) {\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tit->index = 0;\t\t\t\t\t\t\\\n\t\tit->dataptr = it->ao->data;\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_>=0; _i_--) {\t\t\t\\\n\t\t\tit->dataptr += destination[_i_] *\t\t\\\n\t\t\t\tit->strides[_i_];\t\t\t\\\n\t\t\tit->coordinates[_i_] = destination[_i_];\t\\\n\t\t\tit->index += destination[_i_] *\t\t\t\\\n\t\t\t\t( _i_==it->nd_m1 ? 1 :\t\t\t\\\n\t\t\t\t  it->dims_m1[i+1]+1) ;\t  \t        \\\n\t\t}\t\t\t\t\t\t\t\\\n\t} \n\n#define PyArray_ITER_GOTO1D(it, ind) {                                  \\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tintp _lind_ = (intp) (ind);\t\t\t\t\\\n\t\tit->index = _lind_;\t\t\t\t\t\\\n\t\tif (it->contiguous)\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data + (ind) *\t\t\\\n\t\t\t\tit->ao->itemsize;\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data;\t\t\t\\\n\t\t\tfor (_i_ = 0; _i_<=it->nd_m1; _i_++) {\t\t\\\n\t\t\t\tit->dataptr += (_lind_ / it->factors[_i_]) \\\n\t\t\t\t\t* it->strides[_i_];\t\t\\\n\t\t\t\t_lind_ %= it->factors[_i_];\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n}\n\n/* Not constructed anywhere.  Just serves as a standard type that\n   PyArray_Broadcast expects.\n\n   Any object passed to PyArray_Broadcast must be binary compatible with \n   this structure.    \n*/\n\n\ntypedef struct {\n\tPyObject_HEAD\n\n\tint                     numiter;               /* number of iters */\n\tintp                    size;                  /* broadcasted size */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* iterators */\n} PyArrayMultiIterObject;  \n\t\n\n/* Store the information needed for fancy-indexing over an array */\n\ntypedef struct {\n\tPyObject_HEAD\n\t/* Multi-iterator portion --- needs to be present in this order to \n\t   work with PyArray_Broadcast */\n\n\tint                     numiter;               /* number of index-array\n\t\t\t\t\t\t\t  iterators */\n\tintp                    size;                  /* size of broadcasted \n\t\t\t\t\t\t\t  result */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* index object \n\t\t\t\t\t\t\t  iterators */\n\tPyArrayIterObject       *ait;                   /* flat Iterator for \n\t\t\t\t\t\t\t  underlying array */\n\n\t/* flat iterator for subspace (when numiter < nd) */\n\tPyArrayIterObject       *subspace;\n\n\t/* if subspace iteration, then this is the array of \n\t   axes in the underlying array represented by the\n\t   index objects */\n\tint                     iteraxes[MAX_DIMS];\n\t/* if subspace iteration, the these are the coordinates\n\t   to the start of the subspace.\n\t*/\n\tintp                    bscoord[MAX_DIMS];\n\n\t\n\tPyObject                *indexobj;             /* reference to \n\t\t\t\t\t\t\t  creating obj */\n\tint                     view;\n\tint                     consec;\n\tchar                    *dataptr;\n\n} PyArrayMapIterObject;\n\n\n/* Map Iterator API */ \n#define PyArrayMapIter_Check(op) PyObject_TypeCheck(op, &PyArrayMapIter_Type)\n\n\n#define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd)\n#define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, CONTIGUOUS) || \\\n\t\t\t\t PyArray_CHKFLAGS(m, FORTRAN))\n#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, FORTRAN) && (PyArray_NDIM(m) > 1))\n#define PyArray_DATA(obj) (((PyArrayObject *)(obj))->data)\n#define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions)\n#define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides)\n#define PyArray_DIM(obj,n) (((PyArrayObject *)(obj))->dimensions[n])\n#define PyArray_STRIDE(obj,n) (((PyArrayObject *)(obj))->strides[n])\n#define PyArray_BASE(obj) (((PyArrayObject *)(obj))->base)\n#define PyArray_DESCR(obj) (((PyArrayObject *)(obj))->descr)\n#define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags)\n#define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->itemsize)\n#define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num)\n#define PyArray_GETITEM(obj,itemptr)\t\t\t\\\n\t((PyArrayObject *)(obj))->descr->getitem((char *)itemptr,\t\\\n\t\t\t\t\t\t (PyArrayObject *)obj);\n#define PyArray_SETITEM(obj,itemptr,v)\t\t\t\t\t\\\n\t(obj)->descr->setitem((PyObject *)v,(char *)(itemptr),\t\t\\\n\t\t\t      (PyArrayObject *)(obj));\n\n\n#define PyTypeNum_ISBOOL(type) (type == PyArray_BOOL)\n#define PyTypeNum_ISUNSIGNED(type) ((type == PyArray_UBYTE) || \\\n\t\t\t\t (type == PyArray_USHORT) || \\\n\t\t\t\t (type == PyArray_UINT) ||\t\\\n\t\t\t\t (type == PyArray_ULONG) || \\\n\t\t\t\t (type == PyArray_ULONGLONG))\n\n#define PyTypeNum_ISSIGNED(type) ((type == PyArray_BYTE) ||\t\\\n\t\t\t       (type == PyArray_SHORT) ||\t\\\n\t\t\t       (type == PyArray_INT) ||\t\\\n\t\t\t       (type == PyArray_LONG) ||\t\\\n\t\t\t       (type == PyArray_LONGLONG))\n\n#define PyTypeNum_ISINTEGER(type) ((type >= PyArray_BYTE) &&\t\\\n\t\t\t\t(type <= PyArray_ULONGLONG))\n       \n#define PyTypeNum_ISFLOAT(type) ((type >= PyArray_FLOAT) &&  \\\n\t\t\t      (type <= PyArray_LONGDOUBLE))\n\n#define PyTypeNum_ISNUMBER(type) (type <= PyArray_CLONGDOUBLE)\n\n#define PyTypeNum_ISSTRING(type) ((type == PyArray_UCHAR) || \\\n\t\t\t       (type == PyArray_UNICODE))\n\n#define PyTypeNum_ISCOMPLEX(type) ((type >= PyArray_CFLOAT) && \\\n\t\t\t\t(type <= PyArray_CLONGDOUBLE))\n\t\n#define PyTypeNum_ISPYTHON(type) ((type == PyArray_LONG) || \\\n\t\t\t\t  (type == PyArray_DOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_CDOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_OBJECT ))\n\n#define PyTypeNum_ISFLEXIBLE(type) ((type==PyArray_STRING) || \\\n\t\t\t\t    (type==PyArray_UNICODE) ||\t\\\n\t\t\t\t    (type==PyArray_VOID))\n\n#define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \\\n\t\t\t\t   (type < PyArray_USERDEF+\\\n\t\t\t\t    PyArray_NUMUSERTYPES))\n\n#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) &&   \\\n\t\t\t\t     (type <= PyArray_VOID)) ||\t   \\\n\t\t\t\t    (type >= PyArray_USERDEF))\n\t\t\t\t    \n#define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT)\n\n#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))\n#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))\n#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))\n#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n#define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj))\n#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))\n\n/* Object arrays ignore notswapped flag */\n#define PyArray_ISNOTSWAPPED(m) (PyArray_CHKFLAGS(m, NOTSWAPPED) || \\\n\t\t\t\t PyArray_ISOBJECT(m))\n\n\n  /*  Often, rather than always convert to an array, \n      we may want to delegate behavior for other objects passed in\n  */\n\n\t/* \n\n#define Py_DELEGATE(op, name)                                     \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, NULL);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS(op, name, args)\t\t\t  \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, args);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS_KWDS(op, name, args, kwds)\t          \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_Call(meth, args, kwds);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\t*/\n\n\n        /* Includes the \"function\" C-API -- these are all stored in a \n\t   list of pointers --- one for each file\n\t   The two lists are concatenated into one in multiarray.\n\t   \n\t   They are available as import_array()\n         */\n\n#include \"__multiarray_api.h\"\n\n\n        /* C-API that requries previous API to be defined */\n\n#define PyArray_Check(op) (PyObject_TypeCheck((op), &PyBigArray_Type))\n#define PyBigArray_CheckExact(op) ((op)->ob_type == &PyBigArray_Type)\n#define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type)\n\n#define PyArray_CheckScalar(m) (PyObject_TypeCheck((m),\t\t\t\\\n\t\t\t\t\t\t   &PyGenericArrType_Type) \\\n\t\t\t\t|| ((PyArray_Check((m))) &&\t\t\\\n\t\t\t\t    (((PyArrayObject *)(m))->nd == 0)))\n#define PyArray_IsScalar(obj, cls)\t\t\t\t\\\n\t(PyObject_TypeCheck((obj), &Py##cls##ArrType_Type))\n#define PyArray_IsPythonScalar(obj) \\\n\t(PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \\\n\t PyLong_Check(obj) || PyBool_Check(obj) || PyString_Check(obj) || \\\n\t PyUnicode_Check(obj))\n#define PyArray_IsAnyScalar(obj) \\\n\t(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))\n\n#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \\\n\t  (PyArrayObject *)(PyArray_ContiguousFromObject((PyObject *)(m), \\\n\t\t                      PyArray_TYPE(m), 0, 0))) \n\n#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))\n#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))\n#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0)\n#define PyArray_FROM_OF(m,flags) PyArray_FromAny(m, NULL, 0, 0, flags)\n\n#define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)\n#define MAX_ELSIZE 2*SIZEOF_LONGDOUBLE\n\n#define PyArray_SimpleNew(nd, dims, typenum) \\\n\tPyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)\n\n        /*Compatibility with old Numeric stuff -- don't use in new code */\n\n#define PyArray_UNSIGNED_TYPES\n#define PyArray_SBYTE PyArray_BYTE\n#define PyArray_CHAR PyArray_BYTE\n#define PyArray_CopyArray PyArray_CopyInto\n#define _PyArray_multiply_list PyArray_MultiplyIntList\n#define PyArray_ISSPACESAVER(m) FALSE\n#define PyScalarArray_Check PyArray_CheckScalar\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !Py_ARRAYOBJECT_H */\n",
                "source_code_before": "\n/* This expects the following variables to be defined (besides\n   the usual ones from pyconfig.h\n\n   SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no\n                         long double is present on platform.\n   CHAR_BIT       --     number of bits in a char (usually 8)\n                         (should be in limits.h)\n*/\n\n#ifndef Py_ARRAYOBJECT_H\n#define Py_ARRAYOBJECT_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"config.h\"\n\n/* There are several places in the code where an array of dimensions is */\n/* allocated statically.  This is the size of that static allocation. */\n\n#define MAX_DIMS 40\n\n/* Used for Converter Functions \"O&\" code in ParseTuple */\n#define PY_FAIL 0\n#define PY_SUCCEED 1\n\n#define NDARRAY_VERSION 0x0400\n\n\t/* Some platforms don't define bool, long long, or long double.\n\t   Handle that here.\n\t */\n\n#ifdef PY_LONG_LONG\ntypedef PY_LONG_LONG longlong;\ntypedef unsigned PY_LONG_LONG ulonglong;\n#  ifdef _MSC_VER\n#    define LONGLONG_FMT         \"%I64d\"\n#    define ULONGLONG_FMT        \"%I64u\"\n#    define LONGLONG_SUFFIX(x)   (x##i64)\n#    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n#  else\n\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant\n           #define ULONGLONG_FMT  \"%llu\"\n\n\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?\n\t   #define ULONGLONG_FMT   \"%qu\"\n\t*/\n#    define LONGLONG_FMT         \"%Ld\"\n#    define ULONGLONG_FMT        \"%Lu\"\n#    define LONGLONG_SUFFIX(x)   (x##LL)\n#    define ULONGLONG_SUFFIX(x)  (x##ULL)\n#  endif\n#else\ntypedef long longlong;\ntypedef unsigned long ulonglong;\n#  define LONGLONG_SUFFIX(x)  (x##L)\n#  define ULONGLONG_SUFFIX(x) (x##UL)\n#endif\n\ntypedef unsigned char Bool;\n#ifndef FALSE\n#define FALSE 0\n#endif\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE\n\ttypedef double longdouble;\n        #define LONGDOUBLE_FMT \"g\"\n#else\n\ttypedef long double longdouble;\n        #define LONGDOUBLE_FMT \"Lg\"\n#endif\n\n#ifndef Py_USING_UNICODE\n#define Py_UNICODE char\n#endif\n\n\ntypedef signed char byte;\ntypedef unsigned char ubyte;\ntypedef unsigned short ushort;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\n\ntypedef struct { float real, imag; } cfloat;\ntypedef struct { double real, imag; } cdouble;\ntypedef struct {longdouble real, imag;} clongdouble;\n\nenum PyArray_TYPES {    PyArray_BOOL=0,\n                        PyArray_BYTE, PyArray_UBYTE,\n\t\t        PyArray_SHORT, PyArray_USHORT,\n\t\t        PyArray_INT, PyArray_UINT,\n\t\t\tPyArray_LONG, PyArray_ULONG,\n                        PyArray_LONGLONG, PyArray_ULONGLONG,\n\t\t\tPyArray_FLOAT, PyArray_DOUBLE, PyArray_LONGDOUBLE,\n\t\t\tPyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CLONGDOUBLE,\n\t\t\tPyArray_OBJECT=17,\n                        PyArray_STRING, PyArray_UNICODE,\n\t\t\tPyArray_VOID,\n\t\t\tPyArray_NTYPES,\n\t\t\tPyArray_NOTYPE,\n\t\t\tPyArray_USERDEF=256  /* leave room for characters */\n};\n\n\t/* basetype array priority */\n#define PyArray_PRIORITY 0.0\n#define PyArray_BIG_PRIORITY 0.1\n\t/* default subtype priority */\n#define PyArray_SUBTYPE_PRIORITY 1.0\n\n\t/* How many floating point types are there */\n#define PyArray_NUM_FLOATTYPE 3\n\n\n\t/* We need to match intp to a signed integer of the same size as\n\t   a pointer variable. uintp to the equivalent unsigned integer\n\t*/\n\n\n\t/* These characters correspond to the array type and the\n\t   struct module */\n\n\t/*  except 'p' -- signed integer for pointer type */\n\nenum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n\t\t\tPyArray_BYTELTR = 'b',\n\t\t\tPyArray_UBYTELTR = 'B',\n\t\t\tPyArray_SHORTLTR = 'h',\n\t\t\tPyArray_USHORTLTR = 'H',\n\t\t\tPyArray_INTLTR = 'i',\n\t\t\tPyArray_UINTLTR = 'I',\n\t\t\tPyArray_LONGLTR = 'l',\n\t\t\tPyArray_ULONGLTR = 'L',  \n\t\t\tPyArray_LONGLONGLTR = 'q',   \n\t\t\tPyArray_ULONGLONGLTR = 'Q',\n\t\t\tPyArray_FLOATLTR = 'f',\n\t\t\tPyArray_DOUBLELTR = 'd',\n\t\t\tPyArray_LONGDOUBLELTR = 'g',\n\t\t\tPyArray_CFLOATLTR = 'F',\n\t\t\tPyArray_CDOUBLELTR = 'D',\n\t\t\tPyArray_CLONGDOUBLELTR = 'G',\n\t\t\tPyArray_OBJECTLTR = 'O',\n\t\t\tPyArray_STRINGLTR = 'S',\n\t\t\tPyArray_UNICODELTR = 'U',\n\t\t        PyArray_VOIDLTR = 'V',\n\n\t\t\t/* No Descriptor, just a define -- this let's\n\t\t\t Python users specify an array of integers\n\t\t\t large enough to hold a pointer on the platform*/\n\t\t\tPyArray_INTPLTR = 'p',\n\t\t\tPyArray_UINTPLTR = 'P',\n\n\t\t\tPyArray_GENBOOLLTR ='b',\n\t\t\tPyArray_SIGNEDLTR = 'i',\n\t\t\tPyArray_UNSIGNEDLTR = 'u',\n\t\t\tPyArray_FLOATINGLTR = 'f',\n\t\t\tPyArray_COMPLEXLTR = 'c'\n};\n\n\t/* Define bit-width array types and typedefs */\n\n#define MAKEFLOAT(x) x.\n\n#define MAX_INT8 127\n#define MIN_INT8 -128\n#define MAX_UINT8 255\n#define MAX_INT16 32767\n#define MIN_INT16 -32768\n#define MAX_UINT16 65535\n#define MAX_INT32 2147483647\n#define MIN_INT32 (-MAX_INT32 - 1)\n#define MAX_UINT32 4294967295U\n#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)\n#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))\n#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)\n#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)\n#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))\n#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)\n#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)\n#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))\n#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\n\t/* Need to find the number of bits for each type and \n\t   make definitions accordingly. \n\n\t   C states that sizeof(char) == 1 by definition \n\t   \n\t   So, just using the sizeof keyword won't help.  \n\n\t   It also looks like Python itself uses sizeof(char) quite a\n\t   bit, which by definition should be 1 all the time.\n\n\t   Idea: Make Use of CHAR_BIT which should tell us how many\n\t   BITS per CHARACTER\n\t*/\n\n\t/* Include platform definitions -- These are in the C89/90 standard */\n#include <limits.h>  \n#define MAX_BYTE SCHAR_MAX\n#define MIN_BYTE SCHAR_MIN\n#define MAX_UBYTE UCHAR_MAX\n#define MAX_SHORT SHRT_MAX\n#define MIN_SHORT SHRT_MIN\n#define MAX_USHORT USHRT_MAX\n#define MAX_INT   INT_MAX\n#ifndef INT_MIN\n#define INT_MIN (-INT_MAX - 1)\n#endif\n#define MIN_INT   INT_MIN\n#define MAX_UINT  UINT_MAX\n#define MAX_LONG  LONG_MAX\n#define MIN_LONG  LONG_MIN\n#define MAX_ULONG  ULONG_MAX\n\n#define SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE\n#define SIZEOF_LONGLONG SIZEOF_LONG_LONG\n#define BITSOF_BOOL sizeof(Bool)*CHAR_BIT\n#define BITSOF_CHAR CHAR_BIT\n#define BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)\n#define BITSOF_INT (SIZEOF_INT*CHAR_BIT)\n#define BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)\n#define BITSOF_LONGLONG (SIZEOF_LONGLONG*CHAR_BIT)\n#define BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)\n#define BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)\n#define BITSOF_LONGDOUBLE (SIZEOF_LONGDOUBLE*CHAR_BIT)\n\n\n#if BITSOF_LONG == 8\n#define PyArray_INT8 PyArray_LONG\n#define PyArray_UINT8 PyArray_ULONG\n\ttypedef long Int8;\n\ttypedef unsigned long UInt8;\n#define STRBITSOF_LONG \"8\"\n#elif BITSOF_LONG == 16\n#define PyArray_INT16 PyArray_LONG\n#define PyArray_UINT16 PyArray_ULONG\n\ttypedef long Int16;\n\ttypedef unsigned long UInt16;\n#define STRBITSOF_LONG \"16\"\n#elif BITSOF_LONG == 32\n#define PyArray_INT32 PyArray_LONG\n#define PyArray_UINT32 PyArray_ULONG\n\ttypedef long Int32;\n\ttypedef unsigned long UInt32;\n#define STRBITSOF_LONG \"32\"\n#elif BITSOF_LONG == 64\n#define PyArray_INT64 PyArray_LONG\n#define PyArray_UINT64 PyArray_ULONG\n\ttypedef long Int64;\n\ttypedef unsigned long UInt64;\n#define STRBITSOF_LONG \"64\"\n#elif BITSOF_LONG == 128\n#define PyArray_INT128 PyArray_LONG\n#define PyArray_UINT128 PyArray_ULONG\n\ttypedef long Int128;\n\ttypedef unsigned long UInt128;\n#define STRBITSOF_LONG \"128\"\n#endif\n\n#if BITSOF_LONGLONG == 8\n#  ifndef PyArray_INT8\n#    define PyArray_INT8 PyArray_LONGLONG\n#    define PyArray_UINT8 PyArray_ULONGLONG\n\ttypedef longlong Int8;\n\ttypedef ulonglong UInt8;\n#  endif\n#  define MAX_LONGLONG MAX_INT8\n#  define MIN_LONGLONG MIN_INT8\n#  define MAX_ULONGLONG MAX_UINT8\n#define STRBITSOF_LONGLONG \"8\"\n#elif BITSOF_LONGLONG == 16\n#  ifndef PyArray_INT16\n#    define PyArray_INT16 PyArray_LONGLONG\n#    define PyArray_UINT16 PyArray_ULONGLONG\n\ttypedef longlong Int16;\n\ttypedef ulonglong UInt16;\n#  endif\n#  define MAX_LONGLONG MAX_INT16\n#  define MIN_LONGLONG MIN_INT16\n#  define MAX_ULONGLONG MAX_UINT16\n#define STRBITSOF_LONGLONG \"16\"\n#elif BITSOF_LONGLONG == 32\n#  ifndef PyArray_INT32\n#    define PyArray_INT32 PyArray_LONGLONG\n#    define PyArray_UINT32 PyArray_ULONGLONG\n\ttypedef longlong Int32;\n\ttypedef ulonglong UInt32;\n#  endif\n#  define MAX_LONGLONG MAX_INT32\n#  define MIN_LONGLONG MIN_INT32\n#  define MAX_ULONGLONG MAX_UINT32\n#define STRBITSOF_LONGLONG \"32\"\n#elif BITSOF_LONGLONG == 64\n#  ifndef PyArray_INT64\n#    define PyArray_INT64 PyArray_LONGLONG\n#    define PyArray_UINT64 PyArray_ULONGLONG\n\ttypedef longlong Int64;\n\ttypedef ulonglong UInt64;\n#  endif\n#  define MAX_LONGLONG MAX_INT64\n#  define MIN_LONGLONG MIN_INT64\n#  define MAX_ULONGLONG MAX_UINT64\n#define STRBITSOF_LONGLONG \"64\"\n#elif BITSOF_LONGLONG == 128\n#  ifndef PyArray_INT128\n#    define PyArray_INT128 PyArray_LONGLONG\n#    define PyArray_UINT128 PyArray_ULONGLONG\n\ttypedef longlong Int128;\n\ttypedef ulonglong UInt128;\n#  endif\n#  define MAX_LONGLONG MAX_INT128\n#  define MIN_LONGLONG MIN_INT128\n#  define MAX_ULONGLONG MAX_UINT128\n#define STRBITSOF_LONGLONG \"128\"\n#elif BITSOF_LONGLONG == 256\n#  define PyArray_INT256 PyArray_LONGLONG\n#  define PyArray_UINT256 PyArray_ULONGLONG\n\ttypedef longlong Int256;\n\ttypedef ulonglong UInt256;\n#  define MAX_LONGLONG MAX_INT256\n#  define MIN_LONGLONG MIN_INT256\n#  define MAX_ULONGLONG MAX_UINT256\n#define STRBITSOF_LONGLONG \"256\"\n#endif\n\n#if BITSOF_INT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_INT\n#define PyArray_UINT8 PyArray_UINT\n\ttypedef int Int8;\n\ttypedef unsigned int UInt8;\n#endif\n#define STRBITSOF_INT \"8\"\n#elif BITSOF_INT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_INT\n#define PyArray_UINT16 PyArray_UINT\n\ttypedef int Int16;\n\ttypedef unsigned int UInt16;\n#endif\n#define STRBITSOF_INT \"16\"\n#elif BITSOF_INT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_INT\n#define PyArray_UINT32 PyArray_UINT\n\ttypedef int Int32;\n\ttypedef unsigned int UInt32;\n#endif\n#define STRBITSOF_INT \"32\"\n#elif BITSOF_INT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_INT\n#define PyArray_UINT64 PyArray_UINT\n\ttypedef int Int64;\n\ttypedef unsigned int UInt64;\n#endif\n#define STRBITSOF_INT \"64\"\n#elif BITSOF_INT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_INT\n#define PyArray_UINT128 PyArray_UINT\n\ttypedef int Int128;\n\ttypedef unsigned int UInt128;\n#endif\n#define STRBITSOF_INT \"128\"\n#endif\n\n#if BITSOF_SHORT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_SHORT\n#define PyArray_UINT8 PyArray_USHORT\n\ttypedef short Int8;\n\ttypedef unsigned short UInt8;\n#endif\n#define STRBITSOF_SHORT \"8\"\n#elif BITSOF_SHORT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_SHORT\n#define PyArray_UINT16 PyArray_USHORT\n\ttypedef short Int16;\n\ttypedef unsigned short UInt16;\n#endif\n#define STRBITSOF_SHORT \"16\"\n#elif BITSOF_SHORT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_SHORT\n#define PyArray_UINT32 PyArray_USHORT\n\ttypedef short Int32;\n\ttypedef unsigned short UInt32;\n#endif\n#define STRBITSOF_SHORT \"32\"\n#elif BITSOF_SHORT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_SHORT\n#define PyArray_UINT64 PyArray_USHORT\n\ttypedef short Int64;\n\ttypedef unsigned short UInt64;\n#endif\n#define STRBITSOF_SHORT \"64\"\n#elif BITSOF_SHORT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_SHORT\n#define PyArray_UINT128 PyArray_USHORT\n\ttypedef short Int128;\n\ttypedef unsigned short UInt128;\n#endif\n#define STRBITSOF_SHORT \"128\"\n#endif\n\n\n#if BITSOF_CHAR == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_BYTE\n#define PyArray_UINT8 PyArray_UBYTE\n\ttypedef signed char Int8;\n\ttypedef unsigned char UInt8;\n#endif\n#define STRBITSOF_CHAR \"8\"\n#elif BITSOF_CHAR == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_BYTE\n#define PyArray_UINT16 PyArray_UBYTE\n\ttypedef signed char Int16;\n\ttypedef unsigned char UInt16;\n#endif\n#define STRBITSOF_CHAR \"16\"\n#elif BITSOF_CHAR == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_BYTE\n#define PyArray_UINT32 PyArray_UBYTE\n\ttypedef signed char Int32;\n\ttypedef unsigned char UInt32;\n#endif\n#define STRBITSOF_CHAR \"32\"\n#elif BITSOF_CHAR == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_BYTE\n#define PyArray_UINT64 PyArray_UBYTE\n\ttypedef signed char Int64;\n\ttypedef unsigned char UInt64;\n#endif\n#define STRBITSOF_CHAR \"64\"\n#elif BITSOF_CHAR == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_BYTE\n#define PyArray_UINT128 PyArray_UBYTE\n\ttypedef signed char Int128;\n\ttypedef unsigned char UInt128;\n#endif\n#define STRBITSOF_CHAR \"128\"\n#endif\n\n\n\n#if BITSOF_DOUBLE == 16\n#define STRBITSOF_DOUBLE \"16\"\n#define STRBITSOF_CDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_DOUBLE\n#define PyArray_COMPLEX32 PyArray_CDOUBLE\n\ttypedef  double Float16;\n\ttypedef cdouble Complex32;\n#endif\n#elif BITSOF_DOUBLE == 32\n#define STRBITSOF_DOUBLE \"32\"\n#define STRBITSOF_CDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_DOUBLE\n#define PyArray_COMPLEX64 PyArray_CDOUBLE\n\ttypedef double Float32;\n\ttypedef cdouble Complex64;\n#endif\n#elif BITSOF_DOUBLE == 64\n#define STRBITSOF_DOUBLE \"64\"\n#define STRBITSOF_CDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_DOUBLE\n#define PyArray_COMPLEX128 PyArray_CDOUBLE\n\ttypedef double Float64;\n\ttypedef cdouble Complex128;\n#endif\n#elif BITSOF_DOUBLE == 80\n#define STRBITSOF_DOUBLE \"80\"\n#define STRBITSOF_CDOUBLE \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_DOUBLE\n#define PyArray_COMPLEX160 PyArray_CDOUBLE\n\ttypedef double Float80\n\ttypedef cdouble Complex160\n#endif\n#elif BITSOF_DOUBLE == 96\n#define STRBITSOF_DOUBLE \"96\"\n#define STRBITSOF_CDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_DOUBLE\n#define PyArray_COMPLEX192 PyArray_CDOUBLE\n\ttypedef double Float96;\n\ttypedef cdouble Complex192;\n#endif\n#elif BITSOF_DOUBLE == 128\n#define STRBITSOF_DOUBLE \"128\"\n#define STRBITSOF_CDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_DOUBLE\n#define PyArray_COMPLEX256 PyArray_CDOUBLE\n\ttypedef double Float128;\n\ttypedef cdouble Complex256;\n#endif\n#endif\n\n\n\n#if BITSOF_FLOAT == 16\n#define STRBITSOF_FLOAT \"16\"\n#define STRBITSOF_CFLOAT \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_FLOAT\n#define PyArray_COMPLEX32 PyArray_CFLOAT\n\ttypedef float Float16;\n\ttypedef cfloat Complex32;\n#endif\n#elif BITSOF_FLOAT == 32\n#define STRBITSOF_FLOAT \"32\"\n#define STRBITSOF_CFLOAT \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_FLOAT\n#define PyArray_COMPLEX64 PyArray_CFLOAT\n\ttypedef float Float32;\n\ttypedef cfloat Complex64;\n#endif\n#elif BITSOF_FLOAT == 64\n#define STRBITSOF_FLOAT \"64\"\n#define STRBITSOF_CFLOAT \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_FLOAT\n#define PyArray_COMPLEX128 PyArray_CFLOAT\n\ttypedef float Float64;\n\ttypedef cfloat Complex128;\n#endif\n#elif BITSOF_FLOAT == 80\n#define STRBITSOF_FLOAT \"80\"\n#define STRBITSOF_CFLOAT \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_FLOAT\n#define PyArray_COMPLEX160 PyArray_CFLOAT\n\ttypedef float Float80\n\ttypedef cfloat Complex160\n#endif\n#elif BITSOF_FLOAT == 96\n#define STRBITSOF_FLOAT \"96\"\n#define STRBITSOF_CFLOAT \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_FLOAT\n#define PyArray_COMPLEX192 PyArray_CFLOAT\n\ttypedef float Float96;\n\ttypedef cfloat Complex192;\n#endif\n#elif BITSOF_FLOAT == 128\n#define STRBITSOF_FLOAT \"128\"\n#define STRBITSOF_CFLOAT \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_FLOAT\n#define PyArray_COMPLEX256 PyArray_CFLOAT\n\ttypedef float Float128;\n\ttypedef cfloat Complex256;\n#endif\n#endif\n\n\n#if BITSOF_LONGDOUBLE == 16\n#define STRBITSOF_LONGDOUBLE \"16\"\n#define STRBITSOF_CLONGDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX32 PyArray_CLONGDOUBLE\n\ttypedef  longdouble Float16;\n\ttypedef clongdouble Complex32;\n#endif\n#elif BITSOF_LONGDOUBLE == 32\n#define STRBITSOF_LONGDOUBLE \"32\"\n#define STRBITSOF_CLONGDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX64 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float32;\n\ttypedef clongdouble Complex64;\n#endif\n#elif BITSOF_LONGDOUBLE == 64\n#define STRBITSOF_LONGDOUBLE \"64\"\n#define STRBITSOF_CLONGDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX128 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float64;\n\ttypedef clongdouble Complex128;\n#endif\n#elif BITSOF_LONGDOUBLE == 80\n#define STRBITSOF_LONGDOUBLE \"80\"\n#define STRBITSOF_CLONGDOUBLE \"160\" \n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX160 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float80\n\ttypedef clongdouble Complex160\n#endif\n#elif BITSOF_LONGDOUBLE == 96\n#define STRBITSOF_LONGDOUBLE \"96\"\n#define STRBITSOF_CLONGDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX192 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float96;\n\ttypedef clongdouble Complex192;\n#endif\n#elif BITSOF_LONGDOUBLE == 128\n#define STRBITSOF_LONGDOUBLE \"128\"\n#define STRBITSOF_CLONGDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX256 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float128;\n\ttypedef clongdouble Complex256;\n#endif\n#elif BITSOF_LONGDOUBLE == 256\n#define STRBITSOF_LONGDOUBLE \"256\"\n#define STRBITSOF_CLONGDOUBLE \"512\"\n#define PyArray_FLOAT256 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX512 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float256;\n\ttypedef clongdouble Complex512;\n#endif\n\n\n\t/* End of typedefs for numarray style bit-width names */\n\n/* This is to typedef Intp to the appropriate pointer size for this platform.\n * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */\ntypedef Py_intptr_t intp;\ntypedef Py_uintptr_t uintp;\n\n#define INTP_STRFORMAT \"%d\"\n\n#if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n\t#define PyArray_INTP PyArray_INT\n\t#define PyArray_UINTP PyArray_UINT\n        #define PyIntpArrType_Type PyIntArrType_Type\n        #define PyUIntpArrType_Type PyUIntArrType_Type\n\t#define MAX_INTP MAX_INT\n\t#define MIN_INTP MIN_INT\n\t#define MAX_UINTP MAX_UINT\n#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG\n\t#define PyArray_INTP PyArray_LONG\n\t#define PyArray_UINTP PyArray_ULONG\n        #define PyIntpArrType_Type PyLongArrType_Type\n        #define PyUIntpArrType_Type PyULongArrType_Type\n\t#define MAX_INTP MAX_LONG\n\t#define MIN_INTP MIN_LONG\n\t#define MAX_UINTP MAX_ULONG\n#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)\n\t#define PyArray_INTP PyArray_LONGLONG\n\t#define PyArray_UINTP PyArray_ULONGLONG\n        #define PyIntpArrType_Type PyLongLongArrType_Type\n        #define PyUIntpArrType_Type PyULongLongArrType_Type\n\t#define MAX_INTP MAX_LONGLONG\n\t#define MIN_INTP MIN_LONGLONG\n\t#define MAX_UINTP MAX_ULONGLONG\n        #undef INTP_STRFORMAT\n        #define INTP_STRFORMAT \"%Ld\"\n#endif\n\n#define ERR(str) fprintf(stderr, #str); fflush(stderr);\n#define ERR2(str) fprintf(stderr, str); fflush(stderr);\n\n  /* Macros to define how array, and dimension/strides data is\n     allocated. \n  */\n\n  /* Data buffer */\n#define PyDataMem_NEW(size) ((char *)malloc(size))\n  /* #define PyArrayMem_NEW(size) PyMem_NEW(char, size)*/\n#define PyDataMem_FREE(ptr)  free(ptr)\n  /* #define PyArrayMem_FREE(ptr) PyMem_Free(ptr) */\n#define PyDataMem_RENEW(ptr,size) ((char *)realloc(ptr,size))\n\n  /* Dimensions and strides */\n#define PyDimMem_NEW(size) ((intp *)malloc(size*sizeof(intp)))\n#define PyDimMem_FREE(ptr) free(ptr)\n#define PyDimMem_RENEW(ptr,size) ((intp *)realloc(ptr,size*sizeof(intp)))\n\n\n  /* These must deal with unaligned and unbyteswapped data if necessary */\ntypedef PyObject * (PyArray_GetItemFunc) (char *, void *);\ntypedef int (PyArray_SetItemFunc)(PyObject *, char *, void *);\n\ntypedef int (PyArray_CompareFunc)(const void *, const void *, void *);\ntypedef void (PyArray_CopySwapNFunc)(void *, void *, intp, int, int);\ntypedef void (PyArray_CopySwapFunc)(void *, void *, int, int);\ntypedef Bool (PyArray_NonzeroFunc)(void *, void *);\n\n\n  /* These assume aligned and byteswapped data -- a buffer will be\n      used before or contiguous data will be obtained\n  */\ntypedef int (PyArray_ArgFunc)(void*, intp, intp*, void *);\ntypedef void (PyArray_DotFunc)(char *, intp, char *, intp, char *, intp, \n\t\t\t       void *);\ntypedef void (PyArray_VectorUnaryFunc)(void *, void *, intp, void *, void *);\ntypedef int (PyArray_ScanFunc)(FILE *, void *, int, char *, void *);\n\n\ntypedef struct {\n \tPyTypeObject *typeobj;  /* the type object for this type */\n\tchar kind;              /* kind for this type */\n\tchar type;              /* character representing this type */\n\tint type_num;           /* number representing this type */\n\tint elsize;             /* element size for this type -- \n\t\t\t\t   or 0 if variable */\n       \tint alignment;          /* alignment needed for this type */\n\n\t/* Functions to cast to all other standard types*/\n\tPyArray_VectorUnaryFunc *cast[PyArray_NTYPES];\n\n\t/* Functions to get and set items with standard\n\t   Python types -- not array scalars */\n\tPyArray_GetItemFunc *getitem;\n\tPyArray_SetItemFunc *setitem;\n\n\t/* Function to compare items */\n\tPyArray_CompareFunc *compare;\n\n  \t/* Function to select largest */\n\tPyArray_ArgFunc *argmax;\n\n\t/* Function to compute dot product */\n\tPyArray_DotFunc\t*dotfunc;\t   \n\t\n\t/* Function to scan an ASCII file and \n\t   place a single value plus possible separator */\n\tPyArray_ScanFunc *scanfunc;\n\n\t/* Copy and/or swap data.  Memory areas may not overlap */\n\t/*  Use memmove first if they might */\n\tPyArray_CopySwapNFunc *copyswapn;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\t/* Function to determine if data is zero or not */\n\tPyArray_NonzeroFunc *nonzero;\n\n} PyArray_Descr;\n\n\ntypedef struct PyArrayObject {\n\tPyObject_HEAD\n\tchar *data;             /* pointer to raw data buffer */\n\tint nd;                 /* number of dimensions, also called ndim */ \n\tintp *dimensions;       /* size in each dimension */\n        intp *strides;          /* bytes to jump to get to the \n\t\t\t\t   next element in each dimension */\n\tPyObject *base;         /* This object should be decref'd\n\t\t\t\t   upon deletion of array */\n\t                        /* For views it points to the original array */\n\t                        /* For creation from buffer object it points \n\t\t\t\t   to an object that shold be decref'd on \n\t\t\t\t   deletion */\n\t                        /* For UPDATEIFCOPY flag this is an array \n\t\t\t\t   to-be-updated upon deletion of this one */\n\tPyArray_Descr *descr;   /* Pointer to type structure */\n\tint flags;              /* Flags describing array -- see below*/\n\tint itemsize;           /* needed for Flexible size arrays:\n                                   CHAR, UNICODE, and VOID arrays\n \t\t\t         */ \n\tPyObject *weakreflist;  /* For weakreferences */\n\n} PyArrayObject;\n\n#define fortran fortran_  /* For some compilers */\n\ntypedef struct {   /* Just the type_num and itemsize variables \n\t\t      for use in the TypeNum Converter function */\n\tint type_num;\n\tint itemsize;\n\tint fortran;  /* Set to 1 if fortran-defined strides is desired */\n} PyArray_Typecode;\n\ntypedef struct {\n        intp *ptr;\n        int len;\n} PyArray_Dims;\n\n\n/* Mirrors buffer object to ptr */\n\ntypedef struct {\n        PyObject_HEAD\n        PyObject *base;\n        void *ptr;\n        intp len;\n        int flags;        \n} PyArray_Chunk;\n\n/* Array flags */\n#define CONTIGUOUS     1      /* means c-style contiguous (last index\n\t\t\t       varies the fastest) data elements right\n\t\t\t      after each other. */\n\n\t                      /* All 0-d arrays are CONTIGUOUS and FORTRAN\n\t\t\t\t contiguous.  If a 1-d array is CONTIGUOUS\n\t\t\t\t it is also FORTRAN contiguous \n\t\t\t      */\n\n#define FORTRAN    2    /* set if array is a contiguous Fortran array */\n                       /*  first index varies the fastest in memory\n                           (strides array is reverse of C-contiguous\n\t\t\t           array)*/\n\n#define OWNDATA        4\n#define OWN_DATA       OWNDATA\n\n\t/* array never has these three set -- FromAny flags only */\n#define FORCECAST     0x010    \n#define ENSURECOPY    0x020\n#define ENSUREARRAY   0x040\n\n#define ALIGNED       0x100\n#define NOTSWAPPED    0x200\n#define WRITEABLE     0x400\n\n\n\t/* If this flags is set, then base contains a pointer to \n\t   an array of the same size that should be updated with the \n\t   current contents of this array when this array is deallocated\n\t*/\n#define UPDATEIFCOPY  0x1000\n\n\n/* Size of internal buffers used for alignment */\n#define PyArray_BUFSIZE 10000\n#define PyArray_MIN_BUFSIZE 5\n#define PyArray_MAX_BUFSIZE MAX_INT32\n#define MAXBUFNUM 1024\n\n\n#define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n#define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n#define CARRAY_FLAGS CONTIGUOUS | BEHAVED_FLAGS\n#define FARRAY_FLAGS FORTRAN | BEHAVED_FLAGS\n#define DEFAULT_FLAGS CARRAY_FLAGS\n\n#define UPDATE_ALL_FLAGS CONTIGUOUS | FORTRAN | ALIGNED\n\n\n/*\n * C API:  consists of Macros and functions.  The MACROS are defined here. \n */\n\n\n#define PyArray_CHKFLAGS(m, FLAGS) \\\n\t((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))\n#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, CONTIGUOUS)\n#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, WRITEABLE)\n\n#define PyArray_ISCARRAY(m) PyArray_CHKFLAGS(m, CARRAY_FLAGS)\n#define PyArray_ISFARRAY(m) PyArray_CHKFLAGS(m, FARRAY_FLAGS)\n#define PyArray_ISBEHAVED(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS)\n#define PyArray_ISBEHAVED_RO(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS_RO)\n\n\n#ifndef MAX\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#endif\n#ifndef MIN\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#endif\n\n        /* Useful if a and b have to be evaluated.  */\n\n#define tMAX(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_>_y_ ? _x_ : _y_}\n#define tMIN(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_<_y_ ? _x_ : _y_}\n\n#if defined(ALLOW_THREADS)\n#define BEGIN_THREADS_DEF PyThreadState *_save;\n#define BEGIN_THREADS _save = PyEval_SaveThread();\n#define END_THREADS   PyEval_RestoreThread(_save);\n#define ALLOW_C_API_DEF  PyGILState_STATE __save__;\n#define ALLOW_C_API      __save__ = PyGILState_Ensure();\n#define DISABLE_C_API    PyGILState_Release(__save__);\n#else\n#define BEGIN_THREADS_DEF\n#define BEGIN_THREADS\n#define END_THREADS\n#define ALLOW_C_API_DEF\n#define\tALLOW_C_API    \n#define\tDISABLE_C_API  \n#endif\n\ntypedef struct {\n        PyObject_HEAD\n\tint                     nd_m1;            /* number of dimensions - 1 */\n        intp\t\t        index, size;\n\tintp                    coordinates[MAX_DIMS];/* N-dimensional loop */\n        intp                    dims_m1[MAX_DIMS];    /* ao->dimensions - 1 */\n\tintp                    strides[MAX_DIMS];    /* ao->strides or fake */\n\tintp                    backstrides[MAX_DIMS];/* how far to jump back */\n\tintp                    factors[MAX_DIMS];     /* shape factors */\n\tPyArrayObject           *ao;\n\tchar                    *dataptr;        /* pointer to current item*/\n        unsigned char           contiguous;\n} PyArrayIterObject;\n\n\n/* Iterator API */ \n#define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type)\n\t\n#define PyArray_ITER_RESET(it) {\t\t\t\t\t\\\n\tit->index = 0;\t\t\t\t\t\t        \\\n\tit->dataptr = it->ao->data;\t\t\t\t\t\\\n\tmemset(it->coordinates, 0, (it->nd_m1+1)*sizeof(intp));\t\t\\\n}\n\n\n#define PyArray_ITER_NEXT(it) {\t\t\t\t\\\n\tit->index++;\t\t\t\t\t\\\n\tif (it->contiguous)  it->dataptr += it->ao->itemsize;\t       \\\n\telse {\t\t\t\t\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_ >= 0; _i_--) {\t\t\\\n\t\t\tif (it->coordinates[_i_] <\t\t\t\\\n\t\t\t    it->dims_m1[_i_]) {\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_]++;\t\t\t\\\n\t\t\t\tit->dataptr += it->strides[_i_];\t\\\n\t\t\t\tbreak;\t\t\t\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t\telse {\t\t\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_] = 0;\t\t\\\n\t\t\t\tit->dataptr -= it->backstrides[_i_];\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n}\n\n#define PyArray_ITER_GOTO(it, destination) {\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tit->index = 0;\t\t\t\t\t\t\\\n\t\tit->dataptr = it->ao->data;\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_>=0; _i_--) {\t\t\t\\\n\t\t\tit->dataptr += destination[_i_] *\t\t\\\n\t\t\t\tit->strides[_i_];\t\t\t\\\n\t\t\tit->coordinates[_i_] = destination[_i_];\t\\\n\t\t\tit->index += destination[_i_] *\t\t\t\\\n\t\t\t\t( _i_==it->nd_m1 ? 1 :\t\t\t\\\n\t\t\t\t  it->dims_m1[i+1]+1) ;\t  \t        \\\n\t\t}\t\t\t\t\t\t\t\\\n\t} \n\n#define PyArray_ITER_GOTO1D(it, ind) {                                  \\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tintp _lind_ = (intp) (ind);\t\t\t\t\\\n\t\tit->index = _lind_;\t\t\t\t\t\\\n\t\tif (it->contiguous)\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data + (ind) *\t\t\\\n\t\t\t\tit->ao->itemsize;\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data;\t\t\t\\\n\t\t\tfor (_i_ = 0; _i_<=it->nd_m1; _i_++) {\t\t\\\n\t\t\t\tit->dataptr += (_lind_ / it->factors[_i_]) \\\n\t\t\t\t\t* it->strides[_i_];\t\t\\\n\t\t\t\t_lind_ %= it->factors[_i_];\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n}\n\n/* Not constructed anywhere.  Just serves as a standard type that\n   PyArray_Broadcast expects.\n\n   Any object passed to PyArray_Broadcast must be binary compatible with \n   this structure.    \n*/\n\n\ntypedef struct {\n\tPyObject_HEAD\n\n\tint                     numiter;               /* number of iters */\n\tintp                    size;                  /* broadcasted size */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* iterators */\n} PyArrayMultiIterObject;  \n\t\n\n/* Store the information needed for fancy-indexing over an array */\n\ntypedef struct {\n\tPyObject_HEAD\n\t/* Multi-iterator portion --- needs to be present in this order to \n\t   work with PyArray_Broadcast */\n\n\tint                     numiter;               /* number of index-array\n\t\t\t\t\t\t\t  iterators */\n\tintp                    size;                  /* size of broadcasted \n\t\t\t\t\t\t\t  result */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* index object \n\t\t\t\t\t\t\t  iterators */\n\tPyArrayIterObject       *ait;                   /* flat Iterator for \n\t\t\t\t\t\t\t  underlying array */\n\n\t/* flat iterator for subspace (when numiter < nd) */\n\tPyArrayIterObject       *subspace;\n\n\t/* if subspace iteration, then this is the array of \n\t   axes in the underlying array represented by the\n\t   index objects */\n\tint                     iteraxes[MAX_DIMS];\n\t/* if subspace iteration, the these are the coordinates\n\t   to the start of the subspace.\n\t*/\n\tintp                    bscoord[MAX_DIMS];\n\n\t\n\tPyObject                *indexobj;             /* reference to \n\t\t\t\t\t\t\t  creating obj */\n\tint                     view;\n\tint                     consec;\n\tchar                    *dataptr;\n\n} PyArrayMapIterObject;\n\n\n/* Map Iterator API */ \n#define PyArrayMapIter_Check(op) PyObject_TypeCheck(op, &PyArrayMapIter_Type)\n\n\n#define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd)\n#define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, CONTIGUOUS) || \\\n\t\t\t\t PyArray_CHKFLAGS(m, FORTRAN))\n#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, FORTRAN) && (PyArray_NDIM(m) > 1))\n#define PyArray_DATA(obj) (((PyArrayObject *)(obj))->data)\n#define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions)\n#define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides)\n#define PyArray_DIM(obj,n) (((PyArrayObject *)(obj))->dimensions[n])\n#define PyArray_STRIDE(obj,n) (((PyArrayObject *)(obj))->strides[n])\n#define PyArray_BASE(obj) (((PyArrayObject *)(obj))->base)\n#define PyArray_DESCR(obj) (((PyArrayObject *)(obj))->descr)\n#define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags)\n#define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->itemsize)\n#define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num)\n#define PyArray_GETITEM(obj,itemptr)\t\t\t\\\n\t((PyArrayObject *)(obj))->descr->getitem((char *)itemptr,\t\\\n\t\t\t\t\t\t (PyArrayObject *)obj);\n#define PyArray_SETITEM(obj,itemptr,v)\t\t\t\t\t\\\n\t(obj)->descr->setitem((PyObject *)v,(char *)(itemptr),\t\t\\\n\t\t\t      (PyArrayObject *)(obj));\n\n\n#define PyTypeNum_ISBOOL(type) (type == PyArray_BOOL)\n#define PyTypeNum_ISUNSIGNED(type) ((type == PyArray_UBYTE) || \\\n\t\t\t\t (type == PyArray_USHORT) || \\\n\t\t\t\t (type == PyArray_UINT) ||\t\\\n\t\t\t\t (type == PyArray_ULONG) || \\\n\t\t\t\t (type == PyArray_ULONGLONG))\n\n#define PyTypeNum_ISSIGNED(type) ((type == PyArray_BYTE) ||\t\\\n\t\t\t       (type == PyArray_SHORT) ||\t\\\n\t\t\t       (type == PyArray_INT) ||\t\\\n\t\t\t       (type == PyArray_LONG) ||\t\\\n\t\t\t       (type == PyArray_LONGLONG))\n\n#define PyTypeNum_ISINTEGER(type) ((type >= PyArray_BYTE) &&\t\\\n\t\t\t\t(type <= PyArray_ULONGLONG))\n       \n#define PyTypeNum_ISFLOAT(type) ((type >= PyArray_FLOAT) &&  \\\n\t\t\t      (type <= PyArray_LONGDOUBLE))\n\n#define PyTypeNum_ISNUMBER(type) (type <= PyArray_CLONGDOUBLE)\n\n#define PyTypeNum_ISSTRING(type) ((type == PyArray_UCHAR) || \\\n\t\t\t       (type == PyArray_UNICODE))\n\n#define PyTypeNum_ISCOMPLEX(type) ((type >= PyArray_CFLOAT) && \\\n\t\t\t\t(type <= PyArray_CLONGDOUBLE))\n\t\n#define PyTypeNum_ISPYTHON(type) ((type == PyArray_LONG) || \\\n\t\t\t\t  (type == PyArray_DOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_CDOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_OBJECT ))\n\n#define PyTypeNum_ISFLEXIBLE(type) ((type==PyArray_STRING) || \\\n\t\t\t\t    (type==PyArray_UNICODE) ||\t\\\n\t\t\t\t    (type==PyArray_VOID))\n\n#define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \\\n\t\t\t\t   (type < PyArray_USERDEF+\\\n\t\t\t\t    PyArray_NUMUSERTYPES))\n\n#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) &&   \\\n\t\t\t\t     (type <= PyArray_VOID)) ||\t   \\\n\t\t\t\t    (type >= PyArray_USERDEF))\n\t\t\t\t    \n#define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT)\n\n#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))\n#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))\n#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))\n#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n#define PyArray_ISPYTHONTYPE(obj) PyTypeNum_ISPYTHONTYPE(PyArray_TYPE(obj))\n#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))\n\n/* Object arrays ignore notswapped flag */\n#define PyArray_ISNOTSWAPPED(m) (PyArray_CHKFLAGS(m, NOTSWAPPED) || \\\n\t\t\t\t PyArray_ISOBJECT(m))\n\n\n  /*  Often, rather than always convert to an array, \n      we may want to delegate behavior for other objects passed in\n  */\n\n\t/* \n\n#define Py_DELEGATE(op, name)                                     \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, NULL);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS(op, name, args)\t\t\t  \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, args);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS_KWDS(op, name, args, kwds)\t          \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_Call(meth, args, kwds);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\t*/\n\n\n        /* Includes the \"function\" C-API -- these are all stored in a \n\t   list of pointers --- one for each file\n\t   The two lists are concatenated into one in multiarray.\n\t   \n\t   They are available as import_array()\n         */\n\n#include \"__multiarray_api.h\"\n\n\n        /* C-API that requries previous API to be defined */\n\n#define PyArray_Check(op) (PyObject_TypeCheck((op), &PyBigArray_Type))\n#define PyBigArray_CheckExact(op) ((op)->ob_type == &PyBigArray_Type)\n#define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type)\n\n#define PyArray_CheckScalar(m) (PyObject_TypeCheck((m),\t\t\t\\\n\t\t\t\t\t\t   &PyGenericArrType_Type) \\\n\t\t\t\t|| ((PyArray_Check((m))) &&\t\t\\\n\t\t\t\t    (((PyArrayObject *)(m))->nd == 0)))\n#define PyArray_IsScalar(obj, cls)\t\t\t\t\\\n\t(PyObject_TypeCheck((obj), &Py##cls##ArrType_Type))\n#define PyArray_IsPythonScalar(obj) \\\n\t(PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \\\n\t PyLong_Check(obj) || PyBool_Check(obj) || PyString_Check(obj) || \\\n\t PyUnicode_Check(obj))\n#define PyArray_IsAnyScalar(obj) \\\n\t(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))\n\n#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \\\n\t  (PyArrayObject *)(PyArray_ContiguousFromObject((PyObject *)(m), \\\n\t\t                      PyArray_TYPE(m), 0, 0))) \n\n#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))\n#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))\n#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0)\n#define PyArray_FROM_OF(m,flags) PyArray_FromAny(m, NULL, 0, 0, flags)\n\n#define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)\n#define MAX_ELSIZE 2*SIZEOF_LONGDOUBLE\n\n#define PyArray_SimpleNew(nd, dims, typenum) \\\n\tPyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)\n\n        /*Compatibility with old Numeric stuff -- don't use in new code */\n\n#define PyArray_UNSIGNED_TYPES\n#define PyArray_SBYTE PyArray_BYTE\n#define PyArray_CHAR PyArray_BYTE\n#define PyArray_CopyArray PyArray_CopyInto\n#define _PyArray_multiply_list PyArray_MultiplyIntList\n#define PyArray_ISSPACESAVER(m) FALSE\n#define PyScalarArray_Check PyArray_CheckScalar\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !Py_ARRAYOBJECT_H */\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 252,
                "complexity": 0,
                "token_count": 1156,
                "diff_parsed": {
                    "added": [
                        "#define INTP_FMT \"%d\"",
                        "        #undef INTP_FMT",
                        "        #define INTP_FMT \"%Ld\"",
                        "#define PyArray_MAX_BUFSIZE 100000000",
                        "#define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj))"
                    ],
                    "deleted": [
                        "#define MAKEFLOAT(x) x.",
                        "",
                        "#define INTP_STRFORMAT \"%d\"",
                        "        #undef INTP_STRFORMAT",
                        "        #define INTP_STRFORMAT \"%Ld\"",
                        "#define PyArray_MAX_BUFSIZE MAX_INT32",
                        "#define MAXBUFNUM 1024",
                        "",
                        "#define PyArray_ISPYTHONTYPE(obj) PyTypeNum_ISPYTHONTYPE(PyArray_TYPE(obj))"
                    ]
                }
            }
        ]
    },
    {
        "hash": "7fb247958ddbfec142d086302c7e1b969a481934",
        "msg": "Few more fixes for compiler warnings for mtrand.\nI'm still getting 'warning: assignment from incompatible pointer type' due to\nPyrex not applying the <ArrayType> cast. This looks like it's going to be a\nbit of trouble to track it down in Pyrex.",
        "author": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "committer": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "author_date": "2005-10-14T19:50:06+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T19:50:06+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "fb62ac9712cec1b8ca9cf5e9326efa94c3918286"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 27,
        "insertions": 24,
        "lines": 51,
        "files": 3,
        "dmm_unit_size": 1.0,
        "dmm_unit_complexity": 1.0,
        "dmm_unit_interfacing": 1.0,
        "modified_files": [
            {
                "old_path": "scipy/corelib/mtrand/mtrand.c",
                "new_path": "scipy/corelib/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 Thu Oct 13 12:12:52 2005 */\n+/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 15:47:08 2005 */\n \n #include \"Python.h\"\n #include \"structmember.h\"\n@@ -4386,7 +4386,6 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   long __pyx_v_j;\n   long __pyx_v_dn;\n   double __pyx_v_Sum;\n-  double __pyx_v_prob;\n   PyObject *__pyx_v_shape;\n   PyObject *__pyx_v_multin;\n   PyObject *__pyx_r;\n@@ -5644,20 +5643,20 @@ statichere char **__pyx_f = __pyx_filenames;\n /* Runtime support code */\n \n static int __Pyx_GetStarArgs(\n-    PyObject **args, \n+    PyObject **args,\n     PyObject **kwds,\n-    char *kwd_list[], \n+    char *kwd_list[],\n     int nargs,\n-    PyObject **args2, \n+    PyObject **args2,\n     PyObject **kwds2)\n {\n     PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n-    \n+\n     if (args2)\n         *args2 = 0;\n     if (kwds2)\n         *kwds2 = 0;\n-    \n+\n     if (args2) {\n         args1 = PyTuple_GetSlice(*args, 0, nargs);\n         if (!args1)\n@@ -5670,7 +5669,7 @@ static int __Pyx_GetStarArgs(\n         args1 = *args;\n         Py_INCREF(args1);\n     }\n-    \n+\n     if (kwds2) {\n         if (*kwds) {\n             char **p;\n@@ -5700,17 +5699,15 @@ static int __Pyx_GetStarArgs(\n         kwds1 = *kwds;\n         Py_XINCREF(kwds1);\n     }\n-    \n+\n     *args = args1;\n     *kwds = kwds1;\n     return 0;\n bad:\n     Py_XDECREF(args1);\n     Py_XDECREF(kwds1);\n-    if (*args2)\n-        Py_XDECREF(*args2);\n-    if (*kwds2)\n-        Py_XDECREF(*kwds2);\n+    Py_XDECREF(*args2);\n+    Py_XDECREF(*kwds2);\n     return -1;\n }\n \n@@ -5833,23 +5830,23 @@ static void __Pyx_UnpackError(void) {\n }\n \n static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n-  PyObject *item;\n-  if (!(item = PySequence_GetItem(seq, i))) {\n+  PyObject *item = PySequence_GetItem(seq, i);\n+  if (!item) {\n     if (PyErr_ExceptionMatches(PyExc_IndexError))\n-    \t__Pyx_UnpackError();\n+      __Pyx_UnpackError();\n   }\n   return item;\n }\n \n static int __Pyx_EndUnpack(PyObject *seq, int i) {\n-  PyObject *item;\n-  if (item = PySequence_GetItem(seq, 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+  return 0;\n }\n \n static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n@@ -5872,15 +5869,15 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n     return 0;\n }\n \n-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n-    long size) \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+\n     py_module_name = PyString_FromString(module_name);\n     if (!py_module_name)\n         goto bad;\n@@ -5900,13 +5897,13 @@ static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,\n     if (!result)\n         goto bad;\n     if (!PyType_Check(result)) {\n-        PyErr_Format(PyExc_TypeError, \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+        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@@ -5934,7 +5931,7 @@ static void __Pyx_AddTraceback(char *funcname) {\n     PyObject *empty_string = 0;\n     PyCodeObject *py_code = 0;\n     PyFrameObject *py_frame = 0;\n-    \n+\n     py_srcfile = PyString_FromString(__pyx_filename);\n     if (!py_srcfile) goto bad;\n     py_funcname = PyString_FromString(funcname);\n",
                "added_lines": 22,
                "deleted_lines": 25,
                "source_code": "/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 15:47:08 2005 */\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 \"scipy/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 int __Pyx_PrintItem(PyObject *); /*proto*/\nstatic int __Pyx_PrintNewline(void); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic void __Pyx_ReRaise(void); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic PyObject *__Pyx_GetExcValue(void); /*proto*/\nstatic int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/\nstatic int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*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_SetVtable(PyObject *dict, void *vtable); /*proto*/\nstatic int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/\nstatic PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*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_ArrayType = 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_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_scipy;\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n    Py_DECREF(((PyObject *)__pyx_v_obj));\n    __pyx_v_obj = __pyx_3;\n    __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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 *)__pyx_v_state));\n  __pyx_v_state = ((PyObject *)__pyx_1);\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n  Py_INCREF(__pyx_n_MT19937);\n  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n  Py_INCREF(((PyObject *)__pyx_v_state));\n  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_obj));\n  __pyx_v_obj = __pyx_4;\n  __pyx_4 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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 *__pyx_v_parr;\n  PyArrayObject *__pyx_v_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  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);\n  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_parr));\n  __pyx_v_parr = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)__pyx_v_mnarr));\n  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\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(__pyx_v_parr);\n  Py_DECREF(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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 <class>, <instance> */\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 Thu Oct 13 12:12:52 2005 */\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 \"scipy/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 int __Pyx_PrintItem(PyObject *); /*proto*/\nstatic int __Pyx_PrintNewline(void); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic void __Pyx_ReRaise(void); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic PyObject *__Pyx_GetExcValue(void); /*proto*/\nstatic int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/\nstatic int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*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_SetVtable(PyObject *dict, void *vtable); /*proto*/\nstatic int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/\nstatic PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*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_ArrayType = 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_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_scipy;\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n    Py_DECREF(((PyObject *)__pyx_v_obj));\n    __pyx_v_obj = __pyx_3;\n    __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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 *)__pyx_v_state));\n  __pyx_v_state = ((PyObject *)__pyx_1);\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n  Py_INCREF(__pyx_n_MT19937);\n  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n  Py_INCREF(((PyObject *)__pyx_v_state));\n  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_obj));\n  __pyx_v_obj = __pyx_4;\n  __pyx_4 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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 *__pyx_v_parr;\n  PyArrayObject *__pyx_v_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  double __pyx_v_prob;\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  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);\n  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_parr));\n  __pyx_v_parr = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)__pyx_v_mnarr));\n  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\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(__pyx_v_parr);\n  Py_DECREF(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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    if (*args2)\n        Py_XDECREF(*args2);\n    if (*kwds2)\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 <class>, <instance> */\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;\n  if (!(item = PySequence_GetItem(seq, i))) {\n    if (PyErr_ExceptionMatches(PyExc_IndexError))\n    \t__Pyx_UnpackError();\n  }\n  return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n  PyObject *item;\n  if (item = PySequence_GetItem(seq, i)) {\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": 178,
                        "end_line": 256,
                        "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": 258,
                        "end_line": 336,
                        "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": 338,
                        "end_line": 416,
                        "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": 418,
                        "end_line": 496,
                        "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": 500,
                        "end_line": 578,
                        "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": 580,
                        "end_line": 658,
                        "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": 660,
                        "end_line": 738,
                        "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": 740,
                        "end_line": 818,
                        "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": 820,
                        "end_line": 859,
                        "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": 864,
                        "end_line": 901,
                        "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": 904,
                        "end_line": 922,
                        "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": 59,
                        "complexity": 10,
                        "token_count": 541,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 929,
                        "end_line": 998,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 1005,
                        "end_line": 1067,
                        "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": 88,
                        "complexity": 19,
                        "token_count": 969,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1079,
                        "end_line": 1185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 107,
                        "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": 1188,
                        "end_line": 1218,
                        "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": 1221,
                        "end_line": 1254,
                        "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": 1260,
                        "end_line": 1307,
                        "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": 1311,
                        "end_line": 1337,
                        "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": 1341,
                        "end_line": 1367,
                        "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": 996,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1375,
                        "end_line": 1516,
                        "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": 1520,
                        "end_line": 1561,
                        "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": 1565,
                        "end_line": 1595,
                        "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": 1603,
                        "end_line": 1679,
                        "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": 1683,
                        "end_line": 1756,
                        "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": 1760,
                        "end_line": 1829,
                        "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": 1833,
                        "end_line": 1859,
                        "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": 1867,
                        "end_line": 1921,
                        "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": 1931,
                        "end_line": 1999,
                        "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": 2007,
                        "end_line": 2059,
                        "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": 2063,
                        "end_line": 2089,
                        "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": 2097,
                        "end_line": 2148,
                        "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": 2158,
                        "end_line": 2227,
                        "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": 2237,
                        "end_line": 2305,
                        "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": 2317,
                        "end_line": 2402,
                        "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": 2410,
                        "end_line": 2461,
                        "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": 2471,
                        "end_line": 2539,
                        "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": 2543,
                        "end_line": 2569,
                        "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": 2577,
                        "end_line": 2628,
                        "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": 2636,
                        "end_line": 2688,
                        "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": 2696,
                        "end_line": 2747,
                        "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": 2755,
                        "end_line": 2806,
                        "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": 2814,
                        "end_line": 2865,
                        "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": 2873,
                        "end_line": 2927,
                        "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": 2935,
                        "end_line": 2989,
                        "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": 2997,
                        "end_line": 3051,
                        "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": 3059,
                        "end_line": 3113,
                        "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": 3121,
                        "end_line": 3173,
                        "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": 3183,
                        "end_line": 3251,
                        "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": 3263,
                        "end_line": 3348,
                        "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": 3360,
                        "end_line": 3444,
                        "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": 3456,
                        "end_line": 3540,
                        "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": 3548,
                        "end_line": 3600,
                        "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": 3608,
                        "end_line": 3659,
                        "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": 3669,
                        "end_line": 3736,
                        "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": 3750,
                        "end_line": 3851,
                        "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": 3861,
                        "end_line": 3928,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3955,
                        "end_line": 4366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 176,
                        "complexity": 35,
                        "token_count": 1726,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4376,
                        "end_line": 4604,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 229,
                        "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": 4608,
                        "end_line": 4679,
                        "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": 4685,
                        "end_line": 4774,
                        "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": 4912,
                        "end_line": 4916,
                        "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": 4918,
                        "end_line": 4929,
                        "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": 4931,
                        "end_line": 4933,
                        "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": 4935,
                        "end_line": 4937,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5113,
                        "end_line": 5635,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 5645,
                        "end_line": 5712,
                        "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": 5714,
                        "end_line": 5745,
                        "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": 5747,
                        "end_line": 5753,
                        "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": 5755,
                        "end_line": 5764,
                        "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": 5766,
                        "end_line": 5826,
                        "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": 5828,
                        "end_line": 5830,
                        "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": 5832,
                        "end_line": 5839,
                        "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": 5841,
                        "end_line": 5850,
                        "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": 5852,
                        "end_line": 5860,
                        "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": 5862,
                        "end_line": 5870,
                        "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": 5872,
                        "end_line": 5920,
                        "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": 5926,
                        "end_line": 5978,
                        "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": 178,
                        "end_line": 256,
                        "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": 258,
                        "end_line": 336,
                        "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": 338,
                        "end_line": 416,
                        "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": 418,
                        "end_line": 496,
                        "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": 500,
                        "end_line": 578,
                        "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": 580,
                        "end_line": 658,
                        "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": 660,
                        "end_line": 738,
                        "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": 740,
                        "end_line": 818,
                        "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": 820,
                        "end_line": 859,
                        "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": 864,
                        "end_line": 901,
                        "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": 904,
                        "end_line": 922,
                        "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": 59,
                        "complexity": 10,
                        "token_count": 541,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 929,
                        "end_line": 998,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 1005,
                        "end_line": 1067,
                        "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": 88,
                        "complexity": 19,
                        "token_count": 969,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1079,
                        "end_line": 1185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 107,
                        "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": 1188,
                        "end_line": 1218,
                        "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": 1221,
                        "end_line": 1254,
                        "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": 1260,
                        "end_line": 1307,
                        "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": 1311,
                        "end_line": 1337,
                        "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": 1341,
                        "end_line": 1367,
                        "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": 996,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1375,
                        "end_line": 1516,
                        "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": 1520,
                        "end_line": 1561,
                        "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": 1565,
                        "end_line": 1595,
                        "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": 1603,
                        "end_line": 1679,
                        "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": 1683,
                        "end_line": 1756,
                        "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": 1760,
                        "end_line": 1829,
                        "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": 1833,
                        "end_line": 1859,
                        "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": 1867,
                        "end_line": 1921,
                        "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": 1931,
                        "end_line": 1999,
                        "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": 2007,
                        "end_line": 2059,
                        "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": 2063,
                        "end_line": 2089,
                        "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": 2097,
                        "end_line": 2148,
                        "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": 2158,
                        "end_line": 2227,
                        "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": 2237,
                        "end_line": 2305,
                        "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": 2317,
                        "end_line": 2402,
                        "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": 2410,
                        "end_line": 2461,
                        "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": 2471,
                        "end_line": 2539,
                        "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": 2543,
                        "end_line": 2569,
                        "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": 2577,
                        "end_line": 2628,
                        "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": 2636,
                        "end_line": 2688,
                        "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": 2696,
                        "end_line": 2747,
                        "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": 2755,
                        "end_line": 2806,
                        "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": 2814,
                        "end_line": 2865,
                        "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": 2873,
                        "end_line": 2927,
                        "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": 2935,
                        "end_line": 2989,
                        "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": 2997,
                        "end_line": 3051,
                        "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": 3059,
                        "end_line": 3113,
                        "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": 3121,
                        "end_line": 3173,
                        "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": 3183,
                        "end_line": 3251,
                        "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": 3263,
                        "end_line": 3348,
                        "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": 3360,
                        "end_line": 3444,
                        "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": 3456,
                        "end_line": 3540,
                        "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": 3548,
                        "end_line": 3600,
                        "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": 3608,
                        "end_line": 3659,
                        "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": 3669,
                        "end_line": 3736,
                        "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": 3750,
                        "end_line": 3851,
                        "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": 3861,
                        "end_line": 3928,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3955,
                        "end_line": 4366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 1729,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4376,
                        "end_line": 4605,
                        "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": 4609,
                        "end_line": 4680,
                        "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": 4686,
                        "end_line": 4775,
                        "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": 4913,
                        "end_line": 4917,
                        "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": 4919,
                        "end_line": 4930,
                        "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": 4932,
                        "end_line": 4934,
                        "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": 4936,
                        "end_line": 4938,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5114,
                        "end_line": 5636,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 66,
                        "complexity": 17,
                        "token_count": 324,
                        "parameters": [
                            "args",
                            "kwds",
                            "nargs",
                            "args2",
                            "kwds2"
                        ],
                        "start_line": 5646,
                        "end_line": 5715,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 5717,
                        "end_line": 5748,
                        "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": 5750,
                        "end_line": 5756,
                        "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": 5758,
                        "end_line": 5767,
                        "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": 5769,
                        "end_line": 5829,
                        "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": 5831,
                        "end_line": 5833,
                        "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": 45,
                        "parameters": [
                            "seq",
                            "i"
                        ],
                        "start_line": 5835,
                        "end_line": 5842,
                        "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": 5844,
                        "end_line": 5853,
                        "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": 5855,
                        "end_line": 5863,
                        "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": 5865,
                        "end_line": 5873,
                        "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": 5875,
                        "end_line": 5923,
                        "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": 5929,
                        "end_line": 5981,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "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": 1729,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4376,
                        "end_line": 4605,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 230,
                        "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": 5872,
                        "end_line": 5920,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 49,
                        "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": 5645,
                        "end_line": 5712,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 68,
                        "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": 5832,
                        "end_line": 5839,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "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": 5926,
                        "end_line": 5978,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "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": 5841,
                        "end_line": 5850,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 4961,
                "complexity": 904,
                "token_count": 47900,
                "diff_parsed": {
                    "added": [
                        "/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 15:47:08 2005 */",
                        "    PyObject **args,",
                        "    char *kwd_list[],",
                        "    PyObject **args2,",
                        "",
                        "",
                        "",
                        "",
                        "    Py_XDECREF(*args2);",
                        "    Py_XDECREF(*kwds2);",
                        "  PyObject *item = PySequence_GetItem(seq, i);",
                        "  if (!item) {",
                        "      __Pyx_UnpackError();",
                        "  PyObject *item = PySequence_GetItem(seq, i);",
                        "  if (item) {",
                        "  return 0;",
                        "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,",
                        "    long size)",
                        "",
                        "        PyErr_Format(PyExc_TypeError,",
                        "        PyErr_Format(PyExc_ValueError,",
                        ""
                    ],
                    "deleted": [
                        "/* Generated by Pyrex 0.9.3.1 on Thu Oct 13 12:12:52 2005 */",
                        "  double __pyx_v_prob;",
                        "    PyObject **args,",
                        "    char *kwd_list[],",
                        "    PyObject **args2,",
                        "",
                        "",
                        "",
                        "",
                        "    if (*args2)",
                        "        Py_XDECREF(*args2);",
                        "    if (*kwds2)",
                        "        Py_XDECREF(*kwds2);",
                        "  PyObject *item;",
                        "  if (!(item = PySequence_GetItem(seq, i))) {",
                        "    \t__Pyx_UnpackError();",
                        "  PyObject *item;",
                        "  if (item = PySequence_GetItem(seq, i)) {",
                        "    return 0;",
                        "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,",
                        "    long size)",
                        "",
                        "        PyErr_Format(PyExc_TypeError,",
                        "        PyErr_Format(PyExc_ValueError,",
                        ""
                    ]
                }
            },
            {
                "old_path": "scipy/corelib/mtrand/mtrand.pyx",
                "new_path": "scipy/corelib/mtrand/mtrand.pyx",
                "filename": "mtrand.pyx",
                "extension": "pyx",
                "change_type": "MODIFY",
                "diff": "@@ -852,7 +852,7 @@ def multinomial(self, long n, object pvals, size=None):\n         cdef double *pix\n         cdef long *mnix\n         cdef long i, j, dn\n-        cdef double Sum, prob\n+        cdef double Sum\n \n         d = len(pvals)\n         parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\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 \"scipy.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_negative_binomial(rk_state *state, long n, double p)\n    long rk_poisson(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 scipy\nimport_array()\n\nimport scipy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n    cdef double *array_data\n    cdef ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a, b)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, n, p)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 scipy array filled with generated values\n    is returned. If size is a tuple, then a scipy 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 = <rk_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 ArrayType 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, <unsigned long *>(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 ArrayType state\n        state = <ArrayType>_sp.empty(624, _sp.Int)\n        memcpy(<void*>(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 ArrayType 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, <void*>(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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Int)\n            length = PyArray_SIZE(array)\n            array_data = <long *>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(<char*>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        # XXX: we really should be doing this by Cholesky decomposition\n        (u,s,v) = _sp.linalg.singular_value_decomposition(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 ArrayType parr, 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 = <double*>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 = <ArrayType>multin\n        mnix = <long*>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()\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 \"scipy.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_negative_binomial(rk_state *state, long n, double p)\n    long rk_poisson(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 scipy\nimport_array()\n\nimport scipy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n    cdef double *array_data\n    cdef ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a, b)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, n, p)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 scipy array filled with generated values\n    is returned. If size is a tuple, then a scipy 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 = <rk_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 ArrayType 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, <unsigned long *>(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 ArrayType state\n        state = <ArrayType>_sp.empty(624, _sp.Int)\n        memcpy(<void*>(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 ArrayType 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, <void*>(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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Int)\n            length = PyArray_SIZE(array)\n            array_data = <long *>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(<char*>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        # XXX: we really should be doing this by Cholesky decomposition\n        (u,s,v) = _sp.linalg.singular_value_decomposition(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 ArrayType parr, mnarr\n        cdef double *pix\n        cdef long *mnix\n        cdef long i, j, dn\n        cdef double Sum, prob\n\n        d = len(pvals)\n        parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n        pix = <double*>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 = <ArrayType>multin\n        mnix = <long*>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()\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": [
                        "        cdef double Sum"
                    ],
                    "deleted": [
                        "        cdef double Sum, prob"
                    ]
                }
            },
            {
                "old_path": "scipy/corelib/mtrand/scipy.pxi",
                "new_path": "scipy/corelib/mtrand/scipy.pxi",
                "filename": "scipy.pxi",
                "extension": "pxi",
                "change_type": "MODIFY",
                "diff": "@@ -33,7 +33,7 @@ cdef extern from \"scipy/arrayobject.h\":\n         int type_num, elsize\n         char type\n \n-    ctypedef class scipy.ArrayType [object PyArrayObject]:\n+    ctypedef extern class scipy.ArrayType [object PyArrayObject]:\n         cdef char *data\n         cdef int nd\n         cdef intp *dimensions\n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "# :Author:    Robert Kern\n# :Copyright: 2004, Enthought, Inc.\n# :License:   BSD Style\n\n\ncdef extern from \"scipy/arrayobject.h\":\n    ctypedef enum PyArray_TYPES:\n        PyArray_BOOL\n        PyArray_BYTE\n        PyArray_UBYTE\n        PyArray_SHORT\n        PyArray_USHORT \n        PyArray_INT\n        PyArray_UINT \n        PyArray_LONG\n        PyArray_ULONG\n        PyArray_FLOAT\n        PyArray_DOUBLE \n        PyArray_LONGDOUBLE\n        PyArray_CFLOAT\n        PyArray_CDOUBLE\n        PyArray_CLONGDOUBLE\n        PyArray_OBJECT\n        PyArray_STRING\n        PyArray_UNICODE\n        PyArray_VOID\n        PyArray_NTYPES\n        PyArray_NOTYPE\n\n    ctypedef int intp \n\n    struct PyArray_Descr:\n        int type_num, elsize\n        char type\n\n    ctypedef extern class scipy.ArrayType [object PyArrayObject]:\n        cdef char *data\n        cdef int nd\n        cdef intp *dimensions\n        cdef intp *strides\n        cdef object base\n        cdef PyArray_Descr *descr\n        cdef int flags\n\n    ArrayType PyArray_SimpleNew(int ndims, intp* dims, int item_type)\n    int PyArray_Check(object obj)\n    ArrayType PyArray_ContiguousFromObject(object obj, PyArray_TYPES type, \n        int mindim, int maxdim)\n    intp PyArray_SIZE(ArrayType arr)\n\n    void import_array()\n",
                "source_code_before": "# :Author:    Robert Kern\n# :Copyright: 2004, Enthought, Inc.\n# :License:   BSD Style\n\n\ncdef extern from \"scipy/arrayobject.h\":\n    ctypedef enum PyArray_TYPES:\n        PyArray_BOOL\n        PyArray_BYTE\n        PyArray_UBYTE\n        PyArray_SHORT\n        PyArray_USHORT \n        PyArray_INT\n        PyArray_UINT \n        PyArray_LONG\n        PyArray_ULONG\n        PyArray_FLOAT\n        PyArray_DOUBLE \n        PyArray_LONGDOUBLE\n        PyArray_CFLOAT\n        PyArray_CDOUBLE\n        PyArray_CLONGDOUBLE\n        PyArray_OBJECT\n        PyArray_STRING\n        PyArray_UNICODE\n        PyArray_VOID\n        PyArray_NTYPES\n        PyArray_NOTYPE\n\n    ctypedef int intp \n\n    struct PyArray_Descr:\n        int type_num, elsize\n        char type\n\n    ctypedef class scipy.ArrayType [object PyArrayObject]:\n        cdef char *data\n        cdef int nd\n        cdef intp *dimensions\n        cdef intp *strides\n        cdef object base\n        cdef PyArray_Descr *descr\n        cdef int flags\n\n    ArrayType PyArray_SimpleNew(int ndims, intp* dims, int item_type)\n    int PyArray_Check(object obj)\n    ArrayType PyArray_ContiguousFromObject(object obj, PyArray_TYPES type, \n        int mindim, int maxdim)\n    intp PyArray_SIZE(ArrayType arr)\n\n    void import_array()\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [
                        "    ctypedef extern class scipy.ArrayType [object PyArrayObject]:"
                    ],
                    "deleted": [
                        "    ctypedef class scipy.ArrayType [object PyArrayObject]:"
                    ]
                }
            }
        ]
    },
    {
        "hash": "0fef6d3790c971fde618d9e9323027b962b6f763",
        "msg": "Support for setuptools, if found. You can use python setup.py bdist_egg to\nmake a Python egg now. This seems to work for scipy_core, but I've had some\ntrouble with scipy proper so far.",
        "author": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "committer": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "author_date": "2005-10-14T19:54:21+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T19:54:21+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "7fb247958ddbfec142d086302c7e1b969a481934"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 4,
        "insertions": 15,
        "lines": 19,
        "files": 1,
        "dmm_unit_size": null,
        "dmm_unit_complexity": null,
        "dmm_unit_interfacing": null,
        "modified_files": [
            {
                "old_path": "scipy/distutils/core.py",
                "new_path": "scipy/distutils/core.py",
                "filename": "core.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,7 +1,12 @@\n \n import types\n from distutils.core import *\n-from distutils.core import setup as old_setup\n+try:\n+    from setuptools import setup as old_setup\n+    have_setuptools = 1\n+except ImportError:\n+    from distutils.core import setup as old_setup\n+    have_setuptools = 0\n \n from scipy.distutils.extension import Extension\n from scipy.distutils.command import config\n@@ -25,7 +30,7 @@\n                   'config_fc':        config_compiler.config_fc,\n                   'config':           config.config,\n                   'build_ext':        build_ext.build_ext,\n-                  'build_py':         build_py.build_py,                \n+                  'build_py':         build_py.build_py,\n                   'build_clib':       build_clib.build_clib,\n                   'sdist':            sdist.sdist,\n                   'install_data':     install_data.install_data,\n@@ -33,6 +38,12 @@\n                   'install':          install.install,\n                   'bdist_rpm':        bdist_rpm.bdist_rpm,\n                   }\n+if have_setuptools:\n+    from setuptools.command import bdist_egg, develop, easy_install, egg_info\n+    scipy_cmdclass['bdist_egg'] = bdist_egg.bdist_egg\n+    scipy_cmdclass['develop'] = develop.develop\n+    scipy_cmdclass['easy_install'] = easy_install.easy_install\n+    scipy_cmdclass['egg_info'] = egg_info.egg_info\n \n def setup(**attr):\n \n@@ -40,9 +51,9 @@ def setup(**attr):\n \n     new_attr = attr.copy()\n     if new_attr.has_key('cmdclass'):\n-        cmdclass.update(new_attr['cmdclass'])        \n+        cmdclass.update(new_attr['cmdclass'])\n     new_attr['cmdclass'] = cmdclass\n-    \n+\n     # Move extension source libraries to libraries\n     libraries = []\n     for ext in new_attr.get('ext_modules',[]):\n",
                "added_lines": 15,
                "deleted_lines": 4,
                "source_code": "\nimport types\nfrom distutils.core import *\ntry:\n    from setuptools import setup as old_setup\n    have_setuptools = 1\nexcept ImportError:\n    from distutils.core import setup as old_setup\n    have_setuptools = 0\n\nfrom scipy.distutils.extension import Extension\nfrom scipy.distutils.command import config\nfrom scipy.distutils.command import build\nfrom scipy.distutils.command import build_py\nfrom scipy.distutils.command import config_compiler\nfrom scipy.distutils.command import build_ext\nfrom scipy.distutils.command import build_clib\nfrom scipy.distutils.command import build_src\nfrom scipy.distutils.command import build_scripts\nfrom scipy.distutils.command import sdist\nfrom scipy.distutils.command import install_data\nfrom scipy.distutils.command import install_headers\nfrom scipy.distutils.command import install\nfrom scipy.distutils.command import bdist_rpm\nfrom scipy.distutils.misc_util import get_data_files\n\nscipy_cmdclass = {'build':            build.build,\n                  'build_src':        build_src.build_src,\n                  'build_scripts':    build_scripts.build_scripts,\n                  'config_fc':        config_compiler.config_fc,\n                  'config':           config.config,\n                  'build_ext':        build_ext.build_ext,\n                  'build_py':         build_py.build_py,\n                  'build_clib':       build_clib.build_clib,\n                  'sdist':            sdist.sdist,\n                  'install_data':     install_data.install_data,\n                  'install_headers':  install_headers.install_headers,\n                  'install':          install.install,\n                  'bdist_rpm':        bdist_rpm.bdist_rpm,\n                  }\nif have_setuptools:\n    from setuptools.command import bdist_egg, develop, easy_install, egg_info\n    scipy_cmdclass['bdist_egg'] = bdist_egg.bdist_egg\n    scipy_cmdclass['develop'] = develop.develop\n    scipy_cmdclass['easy_install'] = easy_install.easy_install\n    scipy_cmdclass['egg_info'] = egg_info.egg_info\n\ndef setup(**attr):\n\n    cmdclass = scipy_cmdclass.copy()\n\n    new_attr = attr.copy()\n    if new_attr.has_key('cmdclass'):\n        cmdclass.update(new_attr['cmdclass'])\n    new_attr['cmdclass'] = cmdclass\n\n    # Move extension source libraries to libraries\n    libraries = []\n    for ext in new_attr.get('ext_modules',[]):\n        new_libraries = []\n        for item in ext.libraries:\n            if type(item) is type(()):\n                lib_name,build_info = item\n                _check_append_ext_library(libraries, item)\n                new_libraries.append(lib_name)\n            else:\n                assert type(item) is type(''),`item`\n                new_libraries.append(item)\n        ext.libraries = new_libraries\n    if libraries:\n        if not new_attr.has_key('libraries'):\n            new_attr['libraries'] = []\n        for item in libraries:\n            _check_append_library(new_attr['libraries'], item)\n\n    # sources in ext_modules or libraries may contain header files\n    if (new_attr.has_key('ext_modules') or new_attr.has_key('libraries')) \\\n       and not new_attr.has_key('headers'):\n        new_attr['headers'] = []\n\n    # Expand directories in data_files to files\n    if new_attr.has_key('data_files'):\n        new_data_files = []\n        for data in new_attr['data_files']:\n            if type(data) is types.StringType:\n                new_data_files.append(get_data_files(data)[0])\n            else:\n                new_data_files.append((data[0],get_data_files(data)))\n        new_attr['data_files'] = new_data_files\n\n    return old_setup(**new_attr)\n\ndef _check_append_library(libraries, item):\n    import warnings\n    for libitem in libraries:\n        if type(libitem) is type(()):\n            if type(item) is type(()):\n                if item[0]==libitem[0]:\n                    if item[1] is libitem[1]:\n                        return\n                    warnings.warn(\"[0] libraries list contains '%s' with\"\\\n                                  \" different build_info\" % (item[0]))\n                    break\n            else:\n                if item==libitem[0]:\n                    warnings.warn(\"[1] libraries list contains '%s' with\"\\\n                                  \" no build_info\" % (item[0]))\n                    break\n        else:\n            if type(item) is type(()):\n                if item[0]==libitem:\n                    warnings.warn(\"[2] libraries list contains '%s' with\"\\\n                                  \" no build_info\" % (item[0]))\n                    break\n            else:\n                if item==libitem:\n                    return\n    libraries.append(item)\n    return\n\ndef _check_append_ext_library(libraries, (lib_name,build_info)):\n    import warnings\n    for item in libraries:\n        if type(item) is type(()):\n            if item[0]==lib_name:\n                if item[1] is build_info:\n                    return\n                warnings.warn(\"[3] libraries list contains '%s' with\"\\\n                              \" different build_info\" % (lib_name))\n                break\n        elif item==lib_name:\n            warnings.warn(\"[4] libraries list contains '%s' with\"\\\n                          \" no build_info\" % (lib_name))\n            break\n    libraries.append((lib_name,build_info))\n    return\n",
                "source_code_before": "\nimport types\nfrom distutils.core import *\nfrom distutils.core import setup as old_setup\n\nfrom scipy.distutils.extension import Extension\nfrom scipy.distutils.command import config\nfrom scipy.distutils.command import build\nfrom scipy.distutils.command import build_py\nfrom scipy.distutils.command import config_compiler\nfrom scipy.distutils.command import build_ext\nfrom scipy.distutils.command import build_clib\nfrom scipy.distutils.command import build_src\nfrom scipy.distutils.command import build_scripts\nfrom scipy.distutils.command import sdist\nfrom scipy.distutils.command import install_data\nfrom scipy.distutils.command import install_headers\nfrom scipy.distutils.command import install\nfrom scipy.distutils.command import bdist_rpm\nfrom scipy.distutils.misc_util import get_data_files\n\nscipy_cmdclass = {'build':            build.build,\n                  'build_src':        build_src.build_src,\n                  'build_scripts':    build_scripts.build_scripts,\n                  'config_fc':        config_compiler.config_fc,\n                  'config':           config.config,\n                  'build_ext':        build_ext.build_ext,\n                  'build_py':         build_py.build_py,                \n                  'build_clib':       build_clib.build_clib,\n                  'sdist':            sdist.sdist,\n                  'install_data':     install_data.install_data,\n                  'install_headers':  install_headers.install_headers,\n                  'install':          install.install,\n                  'bdist_rpm':        bdist_rpm.bdist_rpm,\n                  }\n\ndef setup(**attr):\n\n    cmdclass = scipy_cmdclass.copy()\n\n    new_attr = attr.copy()\n    if new_attr.has_key('cmdclass'):\n        cmdclass.update(new_attr['cmdclass'])        \n    new_attr['cmdclass'] = cmdclass\n    \n    # Move extension source libraries to libraries\n    libraries = []\n    for ext in new_attr.get('ext_modules',[]):\n        new_libraries = []\n        for item in ext.libraries:\n            if type(item) is type(()):\n                lib_name,build_info = item\n                _check_append_ext_library(libraries, item)\n                new_libraries.append(lib_name)\n            else:\n                assert type(item) is type(''),`item`\n                new_libraries.append(item)\n        ext.libraries = new_libraries\n    if libraries:\n        if not new_attr.has_key('libraries'):\n            new_attr['libraries'] = []\n        for item in libraries:\n            _check_append_library(new_attr['libraries'], item)\n\n    # sources in ext_modules or libraries may contain header files\n    if (new_attr.has_key('ext_modules') or new_attr.has_key('libraries')) \\\n       and not new_attr.has_key('headers'):\n        new_attr['headers'] = []\n\n    # Expand directories in data_files to files\n    if new_attr.has_key('data_files'):\n        new_data_files = []\n        for data in new_attr['data_files']:\n            if type(data) is types.StringType:\n                new_data_files.append(get_data_files(data)[0])\n            else:\n                new_data_files.append((data[0],get_data_files(data)))\n        new_attr['data_files'] = new_data_files\n\n    return old_setup(**new_attr)\n\ndef _check_append_library(libraries, item):\n    import warnings\n    for libitem in libraries:\n        if type(libitem) is type(()):\n            if type(item) is type(()):\n                if item[0]==libitem[0]:\n                    if item[1] is libitem[1]:\n                        return\n                    warnings.warn(\"[0] libraries list contains '%s' with\"\\\n                                  \" different build_info\" % (item[0]))\n                    break\n            else:\n                if item==libitem[0]:\n                    warnings.warn(\"[1] libraries list contains '%s' with\"\\\n                                  \" no build_info\" % (item[0]))\n                    break\n        else:\n            if type(item) is type(()):\n                if item[0]==libitem:\n                    warnings.warn(\"[2] libraries list contains '%s' with\"\\\n                                  \" no build_info\" % (item[0]))\n                    break\n            else:\n                if item==libitem:\n                    return\n    libraries.append(item)\n    return\n\ndef _check_append_ext_library(libraries, (lib_name,build_info)):\n    import warnings\n    for item in libraries:\n        if type(item) is type(()):\n            if item[0]==lib_name:\n                if item[1] is build_info:\n                    return\n                warnings.warn(\"[3] libraries list contains '%s' with\"\\\n                              \" different build_info\" % (lib_name))\n                break\n        elif item==lib_name:\n            warnings.warn(\"[4] libraries list contains '%s' with\"\\\n                          \" no build_info\" % (lib_name))\n            break\n    libraries.append((lib_name,build_info))\n    return\n",
                "methods": [
                    {
                        "name": "setup",
                        "long_name": "setup( ** attr )",
                        "filename": "core.py",
                        "nloc": 35,
                        "complexity": 14,
                        "token_count": 265,
                        "parameters": [
                            "attr"
                        ],
                        "start_line": 48,
                        "end_line": 91,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_check_append_library",
                        "long_name": "_check_append_library( libraries , item )",
                        "filename": "core.py",
                        "nloc": 27,
                        "complexity": 10,
                        "token_count": 156,
                        "parameters": [
                            "libraries",
                            "item"
                        ],
                        "start_line": 93,
                        "end_line": 119,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_check_append_ext_library",
                        "long_name": "_check_append_ext_library( libraries , ( lib_name , build_info )",
                        "filename": "core.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 89,
                        "parameters": [
                            "libraries",
                            "lib_name",
                            "build_info"
                        ],
                        "start_line": 121,
                        "end_line": 136,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "setup",
                        "long_name": "setup( ** attr )",
                        "filename": "core.py",
                        "nloc": 35,
                        "complexity": 14,
                        "token_count": 265,
                        "parameters": [
                            "attr"
                        ],
                        "start_line": 37,
                        "end_line": 80,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_check_append_library",
                        "long_name": "_check_append_library( libraries , item )",
                        "filename": "core.py",
                        "nloc": 27,
                        "complexity": 10,
                        "token_count": 156,
                        "parameters": [
                            "libraries",
                            "item"
                        ],
                        "start_line": 82,
                        "end_line": 108,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_check_append_ext_library",
                        "long_name": "_check_append_ext_library( libraries , ( lib_name , build_info )",
                        "filename": "core.py",
                        "nloc": 16,
                        "complexity": 6,
                        "token_count": 89,
                        "parameters": [
                            "libraries",
                            "lib_name",
                            "build_info"
                        ],
                        "start_line": 110,
                        "end_line": 125,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 16,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "setup",
                        "long_name": "setup( ** attr )",
                        "filename": "core.py",
                        "nloc": 35,
                        "complexity": 14,
                        "token_count": 265,
                        "parameters": [
                            "attr"
                        ],
                        "start_line": 48,
                        "end_line": 91,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 44,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 121,
                "complexity": 30,
                "token_count": 795,
                "diff_parsed": {
                    "added": [
                        "try:",
                        "    from setuptools import setup as old_setup",
                        "    have_setuptools = 1",
                        "except ImportError:",
                        "    from distutils.core import setup as old_setup",
                        "    have_setuptools = 0",
                        "                  'build_py':         build_py.build_py,",
                        "if have_setuptools:",
                        "    from setuptools.command import bdist_egg, develop, easy_install, egg_info",
                        "    scipy_cmdclass['bdist_egg'] = bdist_egg.bdist_egg",
                        "    scipy_cmdclass['develop'] = develop.develop",
                        "    scipy_cmdclass['easy_install'] = easy_install.easy_install",
                        "    scipy_cmdclass['egg_info'] = egg_info.egg_info",
                        "        cmdclass.update(new_attr['cmdclass'])",
                        ""
                    ],
                    "deleted": [
                        "from distutils.core import setup as old_setup",
                        "                  'build_py':         build_py.build_py,",
                        "        cmdclass.update(new_attr['cmdclass'])",
                        ""
                    ]
                }
            }
        ]
    },
    {
        "hash": "d40a2d4027adf88600ae208cddc17d45efb939fa",
        "msg": "Fix remaining compile warnings (except for one) in mtrand by using a postprocessor.\nArrayType variables are declared in the .pyx file with a C name of\narrayObject<something>, and the postprocessor checks that they're cast right.\nAlso, remove declarations for unused and undefined internal functions.",
        "author": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "committer": {
            "name": "cookedm",
            "email": "cookedm@localhost"
        },
        "author_date": "2005-10-14T21:35:36+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T21:35:36+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "0fef6d3790c971fde618d9e9323027b962b6f763"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 144,
        "insertions": 176,
        "lines": 320,
        "files": 3,
        "dmm_unit_size": 0.0,
        "dmm_unit_complexity": 0.0,
        "dmm_unit_interfacing": 0.0,
        "modified_files": [
            {
                "old_path": null,
                "new_path": "scipy/corelib/mtrand/generate_mtrand_c.py",
                "filename": "generate_mtrand_c.py",
                "extension": "py",
                "change_type": "ADD",
                "diff": "@@ -0,0 +1,38 @@\n+#!/usr/bin/env python\n+import sys\n+import re\n+import os\n+\n+unused_internal_funcs = ['__Pyx_PrintItem',\n+                         '__Pyx_PrintNewline',\n+                         '__Pyx_ReRaise',\n+                         '__Pyx_GetExcValue',\n+                         '__Pyx_ArgTypeTest',\n+                         '__Pyx_TypeTest',\n+                         '__Pyx_SetVtable',\n+                         '__Pyx_GetVtable',\n+                         '__Pyx_CreateClass']\n+\n+if __name__ == '__main__':\n+    os.system('pyrexc mtrand.pyx')\n+    mtrand_c = open('mtrand.c', 'r')\n+    processed = open('mtrand_pp.c', 'w')\n+    unused_funcs_str = '(' + '|'.join(unused_internal_funcs) + ')'\n+    uifpat = re.compile(r'static \\w+ \\*?'+unused_funcs_str+r'.*/\\*proto\\*/')\n+    for linenum, line in enumerate(mtrand_c):\n+        m = re.match(r'^(\\s+arrayObject\\w*\\s*=\\s*[(])[(]PyObject\\s*[*][)]',\n+                     line)\n+        if m:\n+            line = '%s(PyArrayObject *)%s' % (m.group(1), line[m.end():])\n+        m = uifpat.match(line)\n+        if m:\n+            line = ''\n+        m = re.search(unused_funcs_str, line)\n+        if m:\n+            print >>sys.stderr, \\\n+                \"%s was declared unused, but is used at line %d\" % (m.group(),\n+                                                                    linenum+1)\n+        processed.write(line)\n+    mtrand_c.close()\n+    processed.close()\n+    os.rename('mtrand_pp.c', 'mtrand.c')\n",
                "added_lines": 38,
                "deleted_lines": 0,
                "source_code": "#!/usr/bin/env python\nimport sys\nimport re\nimport os\n\nunused_internal_funcs = ['__Pyx_PrintItem',\n                         '__Pyx_PrintNewline',\n                         '__Pyx_ReRaise',\n                         '__Pyx_GetExcValue',\n                         '__Pyx_ArgTypeTest',\n                         '__Pyx_TypeTest',\n                         '__Pyx_SetVtable',\n                         '__Pyx_GetVtable',\n                         '__Pyx_CreateClass']\n\nif __name__ == '__main__':\n    os.system('pyrexc mtrand.pyx')\n    mtrand_c = open('mtrand.c', 'r')\n    processed = open('mtrand_pp.c', 'w')\n    unused_funcs_str = '(' + '|'.join(unused_internal_funcs) + ')'\n    uifpat = re.compile(r'static \\w+ \\*?'+unused_funcs_str+r'.*/\\*proto\\*/')\n    for linenum, line in enumerate(mtrand_c):\n        m = re.match(r'^(\\s+arrayObject\\w*\\s*=\\s*[(])[(]PyObject\\s*[*][)]',\n                     line)\n        if m:\n            line = '%s(PyArrayObject *)%s' % (m.group(1), line[m.end():])\n        m = uifpat.match(line)\n        if m:\n            line = ''\n        m = re.search(unused_funcs_str, line)\n        if m:\n            print >>sys.stderr, \\\n                \"%s was declared unused, but is used at line %d\" % (m.group(),\n                                                                    linenum+1)\n        processed.write(line)\n    mtrand_c.close()\n    processed.close()\n    os.rename('mtrand_pp.c', 'mtrand.c')\n",
                "source_code_before": null,
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 35,
                "complexity": 0,
                "token_count": 198,
                "diff_parsed": {
                    "added": [
                        "#!/usr/bin/env python",
                        "import sys",
                        "import re",
                        "import os",
                        "",
                        "unused_internal_funcs = ['__Pyx_PrintItem',",
                        "                         '__Pyx_PrintNewline',",
                        "                         '__Pyx_ReRaise',",
                        "                         '__Pyx_GetExcValue',",
                        "                         '__Pyx_ArgTypeTest',",
                        "                         '__Pyx_TypeTest',",
                        "                         '__Pyx_SetVtable',",
                        "                         '__Pyx_GetVtable',",
                        "                         '__Pyx_CreateClass']",
                        "",
                        "if __name__ == '__main__':",
                        "    os.system('pyrexc mtrand.pyx')",
                        "    mtrand_c = open('mtrand.c', 'r')",
                        "    processed = open('mtrand_pp.c', 'w')",
                        "    unused_funcs_str = '(' + '|'.join(unused_internal_funcs) + ')'",
                        "    uifpat = re.compile(r'static \\w+ \\*?'+unused_funcs_str+r'.*/\\*proto\\*/')",
                        "    for linenum, line in enumerate(mtrand_c):",
                        "        m = re.match(r'^(\\s+arrayObject\\w*\\s*=\\s*[(])[(]PyObject\\s*[*][)]',",
                        "                     line)",
                        "        if m:",
                        "            line = '%s(PyArrayObject *)%s' % (m.group(1), line[m.end():])",
                        "        m = uifpat.match(line)",
                        "        if m:",
                        "            line = ''",
                        "        m = re.search(unused_funcs_str, line)",
                        "        if m:",
                        "            print >>sys.stderr, \\",
                        "                \"%s was declared unused, but is used at line %d\" % (m.group(),",
                        "                                                                    linenum+1)",
                        "        processed.write(line)",
                        "    mtrand_c.close()",
                        "    processed.close()",
                        "    os.rename('mtrand_pp.c', 'mtrand.c')"
                    ],
                    "deleted": []
                }
            },
            {
                "old_path": "scipy/corelib/mtrand/mtrand.c",
                "new_path": "scipy/corelib/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 Fri Oct 14 15:47:08 2005 */\n+/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 17:30:55 2005 */\n \n #include \"Python.h\"\n #include \"structmember.h\"\n@@ -17,21 +17,12 @@ 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 int __Pyx_PrintItem(PyObject *); /*proto*/\n-static int __Pyx_PrintNewline(void); /*proto*/\n static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\n-static void __Pyx_ReRaise(void); /*proto*/\n static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\n-static PyObject *__Pyx_GetExcValue(void); /*proto*/\n-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/\n-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*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_SetVtable(PyObject *dict, void *vtable); /*proto*/\n-static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/\n-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*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@@ -177,7 +168,7 @@ 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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -186,7 +177,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -217,15 +208,15 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n-    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((double (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -235,8 +226,8 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -250,14 +241,14 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n   __Pyx_AddTraceback(\"mtrand.cont0_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -266,7 +257,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -297,15 +288,15 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n-    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((double (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -315,8 +306,8 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -330,14 +321,14 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n   __Pyx_AddTraceback(\"mtrand.cont1_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -346,7 +337,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -377,15 +368,15 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n-    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((double (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -395,8 +386,8 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -410,14 +401,14 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n   __Pyx_AddTraceback(\"mtrand.cont2_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -426,7 +417,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -457,15 +448,15 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n-    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((double (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -475,8 +466,8 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -490,7 +481,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n   __Pyx_AddTraceback(\"mtrand.cont3_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\n+  Py_DECREF(arrayObject);\n   Py_DECREF(__pyx_v_size);\n   return __pyx_r;\n }\n@@ -499,7 +490,7 @@ 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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -508,7 +499,7 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -539,15 +530,15 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n-    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((long (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -557,8 +548,8 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -572,14 +563,14 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n   __Pyx_AddTraceback(\"mtrand.disc0_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -588,7 +579,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -619,15 +610,15 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n-    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((long (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -637,8 +628,8 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -652,14 +643,14 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n   __Pyx_AddTraceback(\"mtrand.discnp_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -668,7 +659,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -699,15 +690,15 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n-    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((long (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -717,8 +708,8 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -732,14 +723,14 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n   __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\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 *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -748,7 +739,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n   PyObject *__pyx_3 = 0;\n   PyObject *__pyx_4 = 0;\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n   __pyx_1 = __pyx_v_size == Py_None;\n@@ -779,15 +770,15 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n-    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((long (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -797,8 +788,8 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L2:;\n@@ -812,7 +803,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n   __Pyx_AddTraceback(\"mtrand.discd_array\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\n+  Py_DECREF(arrayObject);\n   Py_DECREF(__pyx_v_size);\n   return __pyx_r;\n }\n@@ -929,7 +920,7 @@ static char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\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 *__pyx_v_obj;\n+  PyArrayObject *arrayObject_obj;\n   PyObject *__pyx_r;\n   int __pyx_1;\n   PyObject *__pyx_2 = 0;\n@@ -941,7 +932,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\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-  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n+  arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n   __pyx_1 = __pyx_v_seed == Py_None;\n@@ -973,12 +964,13 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n     __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n-    Py_DECREF(((PyObject *)__pyx_v_obj));\n-    __pyx_v_obj = __pyx_3;\n-    __pyx_3 = 0;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n-    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_obj->dimensions[0]));\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@@ -991,7 +983,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\n   __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_obj);\n+  Py_DECREF(arrayObject_obj);\n   Py_DECREF(__pyx_v_self);\n   Py_DECREF(__pyx_v_seed);\n   return __pyx_r;\n@@ -1003,7 +995,7 @@ static PyObject *__pyx_n_MT19937;\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 *__pyx_v_state;\n+  PyArrayObject *arrayObject_state;\n   PyObject *__pyx_r;\n   PyObject *__pyx_1 = 0;\n   PyObject *__pyx_2 = 0;\n@@ -1012,7 +1004,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\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-  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n+  arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n@@ -1031,20 +1023,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\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 *)__pyx_v_state));\n-  __pyx_v_state = ((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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n-  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n+  memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n   Py_INCREF(__pyx_n_MT19937);\n   PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n-  Py_INCREF(((PyObject *)__pyx_v_state));\n-  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_state));\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@@ -1061,7 +1053,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\n   __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_state);\n+  Py_DECREF(arrayObject_state);\n   Py_DECREF(__pyx_v_self);\n   return __pyx_r;\n }\n@@ -1078,7 +1070,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\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 *__pyx_v_obj;\n+  PyArrayObject *arrayObject_obj;\n   int __pyx_v_pos;\n   PyObject *__pyx_v_algorithm_name;\n   PyObject *__pyx_v_key;\n@@ -1091,7 +1083,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\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-  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\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@@ -1138,12 +1130,13 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n   __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n-  Py_DECREF(((PyObject *)__pyx_v_obj));\n-  __pyx_v_obj = __pyx_4;\n-  __pyx_4 = 0;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n-  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n+  __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n   if (__pyx_3) {\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n@@ -1162,7 +1155,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   __pyx_L3:;\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n-  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n+  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\n   ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n@@ -1176,7 +1169,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_obj);\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@@ -1380,7 +1373,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   long __pyx_v_hi;\n   long __pyx_v_diff;\n   long (*__pyx_v_array_data);\n-  PyArrayObject *__pyx_v_array;\n+  PyArrayObject *arrayObject;\n   long __pyx_v_length;\n   long __pyx_v_i;\n   PyObject *__pyx_r;\n@@ -1397,7 +1390,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_low);\n   Py_INCREF(__pyx_v_high);\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n+  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n   __pyx_1 = __pyx_v_high == Py_None;\n@@ -1474,15 +1467,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\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 *)__pyx_v_array));\n-    __pyx_v_array = ((PyObject *)__pyx_4);\n+    Py_DECREF(((PyObject *)arrayObject));\n+    arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n-    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n+    __pyx_v_length = PyArray_SIZE(arrayObject);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n-    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n+    __pyx_v_array_data = ((long (*))arrayObject->data);\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n@@ -1492,8 +1485,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n     }\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n-    Py_INCREF(((PyObject *)__pyx_v_array));\n-    __pyx_r = ((PyObject *)__pyx_v_array);\n+    Py_INCREF(((PyObject *)arrayObject));\n+    __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n   }\n   __pyx_L4:;\n@@ -1507,7 +1500,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_array);\n+  Py_DECREF(arrayObject);\n   Py_DECREF(__pyx_v_self);\n   Py_DECREF(__pyx_v_low);\n   Py_DECREF(__pyx_v_high);\n@@ -4378,8 +4371,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   PyObject *__pyx_v_pvals = 0;\n   PyObject *__pyx_v_size = 0;\n   long __pyx_v_d;\n-  PyArrayObject *__pyx_v_parr;\n-  PyArrayObject *__pyx_v_mnarr;\n+  PyArrayObject *arrayObject_parr;\n+  PyArrayObject *arrayObject_mnarr;\n   double (*__pyx_v_pix);\n   long (*__pyx_v_mnix);\n   long __pyx_v_i;\n@@ -4400,8 +4393,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_pvals);\n   Py_INCREF(__pyx_v_size);\n-  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);\n-  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_mnarr);\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@@ -4419,12 +4412,13 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n   __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n-  Py_DECREF(((PyObject *)__pyx_v_parr));\n-  __pyx_v_parr = __pyx_1;\n-  __pyx_1 = 0;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n-  __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n+  __pyx_v_pix = ((double (*))arrayObject_parr->data);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n   __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n@@ -4520,18 +4514,18 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n   Py_INCREF(((PyObject *)__pyx_v_multin));\n-  Py_DECREF(((PyObject *)__pyx_v_mnarr));\n-  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n+  Py_DECREF(((PyObject *)arrayObject_mnarr));\n+  arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n-  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n+  __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n   __pyx_v_i = 0;\n \n   /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n   while (1) {\n-    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n+    __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n     if (!__pyx_5) break;\n \n     /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n@@ -4593,8 +4587,8 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n   __pyx_r = 0;\n   __pyx_L0:;\n-  Py_DECREF(__pyx_v_parr);\n-  Py_DECREF(__pyx_v_mnarr);\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",
                "added_lines": 122,
                "deleted_lines": 128,
                "source_code": "/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 17:30:55 2005 */\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 \"scipy/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_ArrayType = 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_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_scipy;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)arrayObject_mnarr));\n  arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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 <class>, <instance> */\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 Fri Oct 14 15:47:08 2005 */\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 \"scipy/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 int __Pyx_PrintItem(PyObject *); /*proto*/\nstatic int __Pyx_PrintNewline(void); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic void __Pyx_ReRaise(void); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic PyObject *__Pyx_GetExcValue(void); /*proto*/\nstatic int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/\nstatic int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*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_SetVtable(PyObject *dict, void *vtable); /*proto*/\nstatic int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/\nstatic PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*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_ArrayType = 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_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_scipy;\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}\n    Py_DECREF(((PyObject *)__pyx_v_obj));\n    __pyx_v_obj = __pyx_3;\n    __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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 *)__pyx_v_state));\n  __pyx_v_state = ((PyObject *)__pyx_1);\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n  Py_INCREF(__pyx_n_MT19937);\n  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n  Py_INCREF(((PyObject *)__pyx_v_state));\n  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_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(__pyx_v_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 *__pyx_v_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  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_obj));\n  __pyx_v_obj = __pyx_4;\n  __pyx_4 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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 *__pyx_v_array;\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  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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 *)__pyx_v_array));\n    __pyx_v_array = ((PyObject *)__pyx_4);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(__pyx_v_array);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))__pyx_v_array->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n    Py_INCREF(((PyObject *)__pyx_v_array));\n    __pyx_r = ((PyObject *)__pyx_v_array);\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(__pyx_v_array);\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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 *__pyx_v_parr;\n  PyArrayObject *__pyx_v_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  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);\n  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}\n  Py_DECREF(((PyObject *)__pyx_v_parr));\n  __pyx_v_parr = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))__pyx_v_parr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)__pyx_v_mnarr));\n  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\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(__pyx_v_parr);\n  Py_DECREF(__pyx_v_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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 <class>, <instance> */\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": 169,
                        "end_line": 247,
                        "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": 249,
                        "end_line": 327,
                        "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": 329,
                        "end_line": 407,
                        "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": 409,
                        "end_line": 487,
                        "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": 491,
                        "end_line": 569,
                        "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": 571,
                        "end_line": 649,
                        "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": 651,
                        "end_line": 729,
                        "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": 731,
                        "end_line": 809,
                        "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": 811,
                        "end_line": 850,
                        "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": 996,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3948,
                        "end_line": 4359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 4369,
                        "end_line": 4598,
                        "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": 4602,
                        "end_line": 4673,
                        "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": 4679,
                        "end_line": 4768,
                        "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": 4906,
                        "end_line": 4910,
                        "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": 4912,
                        "end_line": 4923,
                        "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": 4925,
                        "end_line": 4927,
                        "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": 4929,
                        "end_line": 4931,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5107,
                        "end_line": 5629,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 5639,
                        "end_line": 5706,
                        "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": 5708,
                        "end_line": 5739,
                        "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": 5741,
                        "end_line": 5747,
                        "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": 5749,
                        "end_line": 5758,
                        "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": 5760,
                        "end_line": 5820,
                        "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": 5822,
                        "end_line": 5824,
                        "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": 5826,
                        "end_line": 5833,
                        "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": 5835,
                        "end_line": 5844,
                        "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": 5846,
                        "end_line": 5854,
                        "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": 5856,
                        "end_line": 5864,
                        "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": 5866,
                        "end_line": 5914,
                        "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": 5920,
                        "end_line": 5972,
                        "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": 178,
                        "end_line": 256,
                        "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": 258,
                        "end_line": 336,
                        "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": 338,
                        "end_line": 416,
                        "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": 418,
                        "end_line": 496,
                        "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": 500,
                        "end_line": 578,
                        "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": 580,
                        "end_line": 658,
                        "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": 660,
                        "end_line": 738,
                        "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": 740,
                        "end_line": 818,
                        "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": 820,
                        "end_line": 859,
                        "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": 864,
                        "end_line": 901,
                        "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": 904,
                        "end_line": 922,
                        "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": 59,
                        "complexity": 10,
                        "token_count": 541,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 929,
                        "end_line": 998,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 70,
                        "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": 1005,
                        "end_line": 1067,
                        "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": 88,
                        "complexity": 19,
                        "token_count": 969,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1079,
                        "end_line": 1185,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 107,
                        "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": 1188,
                        "end_line": 1218,
                        "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": 1221,
                        "end_line": 1254,
                        "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": 1260,
                        "end_line": 1307,
                        "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": 1311,
                        "end_line": 1337,
                        "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": 1341,
                        "end_line": 1367,
                        "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": 996,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 1375,
                        "end_line": 1516,
                        "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": 1520,
                        "end_line": 1561,
                        "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": 1565,
                        "end_line": 1595,
                        "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": 1603,
                        "end_line": 1679,
                        "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": 1683,
                        "end_line": 1756,
                        "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": 1760,
                        "end_line": 1829,
                        "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": 1833,
                        "end_line": 1859,
                        "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": 1867,
                        "end_line": 1921,
                        "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": 1931,
                        "end_line": 1999,
                        "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": 2007,
                        "end_line": 2059,
                        "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": 2063,
                        "end_line": 2089,
                        "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": 2097,
                        "end_line": 2148,
                        "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": 2158,
                        "end_line": 2227,
                        "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": 2237,
                        "end_line": 2305,
                        "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": 2317,
                        "end_line": 2402,
                        "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": 2410,
                        "end_line": 2461,
                        "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": 2471,
                        "end_line": 2539,
                        "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": 2543,
                        "end_line": 2569,
                        "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": 2577,
                        "end_line": 2628,
                        "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": 2636,
                        "end_line": 2688,
                        "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": 2696,
                        "end_line": 2747,
                        "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": 2755,
                        "end_line": 2806,
                        "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": 2814,
                        "end_line": 2865,
                        "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": 2873,
                        "end_line": 2927,
                        "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": 2935,
                        "end_line": 2989,
                        "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": 2997,
                        "end_line": 3051,
                        "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": 3059,
                        "end_line": 3113,
                        "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": 3121,
                        "end_line": 3173,
                        "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": 3183,
                        "end_line": 3251,
                        "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": 3263,
                        "end_line": 3348,
                        "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": 3360,
                        "end_line": 3444,
                        "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": 3456,
                        "end_line": 3540,
                        "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": 3548,
                        "end_line": 3600,
                        "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": 3608,
                        "end_line": 3659,
                        "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": 3669,
                        "end_line": 3736,
                        "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": 3750,
                        "end_line": 3851,
                        "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": 3861,
                        "end_line": 3928,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3955,
                        "end_line": 4366,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 176,
                        "complexity": 35,
                        "token_count": 1726,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 4376,
                        "end_line": 4604,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 229,
                        "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": 4608,
                        "end_line": 4679,
                        "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": 4685,
                        "end_line": 4774,
                        "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": 4912,
                        "end_line": 4916,
                        "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": 4918,
                        "end_line": 4929,
                        "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": 4931,
                        "end_line": 4933,
                        "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": 4935,
                        "end_line": 4937,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5113,
                        "end_line": 5635,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 5645,
                        "end_line": 5712,
                        "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": 5714,
                        "end_line": 5745,
                        "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": 5747,
                        "end_line": 5753,
                        "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": 5755,
                        "end_line": 5764,
                        "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": 5766,
                        "end_line": 5826,
                        "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": 5828,
                        "end_line": 5830,
                        "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": 5832,
                        "end_line": 5839,
                        "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": 5841,
                        "end_line": 5850,
                        "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": 5852,
                        "end_line": 5860,
                        "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": 5862,
                        "end_line": 5870,
                        "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": 5872,
                        "end_line": 5920,
                        "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": 5926,
                        "end_line": 5978,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 53,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "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_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_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": 651,
                        "end_line": 729,
                        "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": 329,
                        "end_line": 407,
                        "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": 249,
                        "end_line": 327,
                        "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": 491,
                        "end_line": 569,
                        "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": 571,
                        "end_line": 649,
                        "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": 731,
                        "end_line": 809,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 79,
                        "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": 169,
                        "end_line": 247,
                        "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": 409,
                        "end_line": 487,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 79,
                        "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": 996,
                        "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_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": 4369,
                        "end_line": 4598,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 230,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 4955,
                "complexity": 904,
                "token_count": 47855,
                "diff_parsed": {
                    "added": [
                        "/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 17:30:55 2005 */",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((double (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((double (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((double (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((double (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((long (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((long (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((long (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((long (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject_obj;",
                        "  arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);",
                        "    Py_INCREF(((PyObject *)__pyx_3));",
                        "    Py_DECREF(((PyObject *)arrayObject_obj));",
                        "    arrayObject_obj = ((PyArrayObject *)__pyx_3);",
                        "    Py_DECREF(__pyx_3); __pyx_3 = 0;",
                        "    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));",
                        "  Py_DECREF(arrayObject_obj);",
                        "  PyArrayObject *arrayObject_state;",
                        "  arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);",
                        "  Py_DECREF(((PyObject *)arrayObject_state));",
                        "  arrayObject_state = ((PyArrayObject *)__pyx_1);",
                        "  memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));",
                        "  Py_INCREF(((PyObject *)arrayObject_state));",
                        "  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));",
                        "  Py_DECREF(arrayObject_state);",
                        "  PyArrayObject *arrayObject_obj;",
                        "  arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);",
                        "  Py_INCREF(((PyObject *)__pyx_4));",
                        "  Py_DECREF(((PyObject *)arrayObject_obj));",
                        "  arrayObject_obj = ((PyArrayObject *)__pyx_4);",
                        "  Py_DECREF(__pyx_4); __pyx_4 = 0;",
                        "  __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);",
                        "  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));",
                        "  Py_DECREF(arrayObject_obj);",
                        "  PyArrayObject *arrayObject;",
                        "  arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);",
                        "    Py_DECREF(((PyObject *)arrayObject));",
                        "    arrayObject = ((PyArrayObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(arrayObject);",
                        "    __pyx_v_array_data = ((long (*))arrayObject->data);",
                        "    Py_INCREF(((PyObject *)arrayObject));",
                        "    __pyx_r = ((PyObject *)arrayObject);",
                        "  Py_DECREF(arrayObject);",
                        "  PyArrayObject *arrayObject_parr;",
                        "  PyArrayObject *arrayObject_mnarr;",
                        "  arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);",
                        "  arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);",
                        "  Py_INCREF(((PyObject *)__pyx_1));",
                        "  Py_DECREF(((PyObject *)arrayObject_parr));",
                        "  arrayObject_parr = ((PyArrayObject *)__pyx_1);",
                        "  Py_DECREF(__pyx_1); __pyx_1 = 0;",
                        "  __pyx_v_pix = ((double (*))arrayObject_parr->data);",
                        "  Py_DECREF(((PyObject *)arrayObject_mnarr));",
                        "  arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);",
                        "  __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);",
                        "    __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));",
                        "  Py_DECREF(arrayObject_parr);",
                        "  Py_DECREF(arrayObject_mnarr);"
                    ],
                    "deleted": [
                        "/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 15:47:08 2005 */",
                        "static int __Pyx_PrintItem(PyObject *); /*proto*/",
                        "static int __Pyx_PrintNewline(void); /*proto*/",
                        "static void __Pyx_ReRaise(void); /*proto*/",
                        "static PyObject *__Pyx_GetExcValue(void); /*proto*/",
                        "static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/",
                        "static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/",
                        "static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/",
                        "static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/",
                        "static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((double (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((double (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((double (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((double (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((long (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((long (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((long (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((long (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_obj;",
                        "  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);",
                        "    Py_DECREF(((PyObject *)__pyx_v_obj));",
                        "    __pyx_v_obj = __pyx_3;",
                        "    __pyx_3 = 0;",
                        "    init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))__pyx_v_obj->data),(__pyx_v_obj->dimensions[0]));",
                        "  Py_DECREF(__pyx_v_obj);",
                        "  PyArrayObject *__pyx_v_state;",
                        "  __pyx_v_state = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_state);",
                        "  Py_DECREF(((PyObject *)__pyx_v_state));",
                        "  __pyx_v_state = ((PyObject *)__pyx_1);",
                        "  memcpy(((void (*))__pyx_v_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));",
                        "  Py_INCREF(((PyObject *)__pyx_v_state));",
                        "  PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_state));",
                        "  Py_DECREF(__pyx_v_state);",
                        "  PyArrayObject *__pyx_v_obj;",
                        "  __pyx_v_obj = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_obj);",
                        "  Py_DECREF(((PyObject *)__pyx_v_obj));",
                        "  __pyx_v_obj = __pyx_4;",
                        "  __pyx_4 = 0;",
                        "  __pyx_3 = ((__pyx_v_obj->dimensions[0]) != 624);",
                        "  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))__pyx_v_obj->data),(624 * (sizeof(long ))));",
                        "  Py_DECREF(__pyx_v_obj);",
                        "  PyArrayObject *__pyx_v_array;",
                        "  __pyx_v_array = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_array);",
                        "    Py_DECREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_v_array = ((PyObject *)__pyx_4);",
                        "    __pyx_v_length = PyArray_SIZE(__pyx_v_array);",
                        "    __pyx_v_array_data = ((long (*))__pyx_v_array->data);",
                        "    Py_INCREF(((PyObject *)__pyx_v_array));",
                        "    __pyx_r = ((PyObject *)__pyx_v_array);",
                        "  Py_DECREF(__pyx_v_array);",
                        "  PyArrayObject *__pyx_v_parr;",
                        "  PyArrayObject *__pyx_v_mnarr;",
                        "  __pyx_v_parr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_parr);",
                        "  __pyx_v_mnarr = (void *)Py_None; Py_INCREF((PyObject *) __pyx_v_mnarr);",
                        "  Py_DECREF(((PyObject *)__pyx_v_parr));",
                        "  __pyx_v_parr = __pyx_1;",
                        "  __pyx_1 = 0;",
                        "  __pyx_v_pix = ((double (*))__pyx_v_parr->data);",
                        "  Py_DECREF(((PyObject *)__pyx_v_mnarr));",
                        "  __pyx_v_mnarr = ((PyObject *)__pyx_v_multin);",
                        "  __pyx_v_mnix = ((long (*))__pyx_v_mnarr->data);",
                        "    __pyx_5 = (__pyx_v_i < PyArray_SIZE(__pyx_v_mnarr));",
                        "  Py_DECREF(__pyx_v_parr);",
                        "  Py_DECREF(__pyx_v_mnarr);"
                    ]
                }
            },
            {
                "old_path": "scipy/corelib/mtrand/mtrand.pyx",
                "new_path": "scipy/corelib/mtrand/mtrand.pyx",
                "filename": "mtrand.pyx",
                "extension": "pyx",
                "change_type": "MODIFY",
                "diff": "@@ -117,7 +117,7 @@\n \n cdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n     cdef double *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -133,7 +133,7 @@\n \n cdef object cont1_array(rk_state *state, rk_cont1 func, object size, double a):\n     cdef double *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -150,7 +150,7 @@\n cdef object cont2_array(rk_state *state, rk_cont2 func, object size, double a, \n     double b):\n     cdef double *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -168,7 +168,7 @@\n     double b, double c):\n \n     cdef double *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n     \n@@ -184,7 +184,7 @@\n \n cdef object disc0_array(rk_state *state, rk_disc0 func, object size):\n     cdef long *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -200,7 +200,7 @@\n \n cdef object discnp_array(rk_state *state, rk_discnp func, object size, long n, double p):\n     cdef long *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -217,7 +217,7 @@\n cdef 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 ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -233,7 +233,7 @@\n \n cdef object discd_array(rk_state *state, rk_discd func, object size, double a):\n     cdef long *array_data\n-    cdef ArrayType array\n+    cdef ArrayType array \"arrayObject\"\n     cdef long length\n     cdef long i\n \n@@ -299,13 +299,13 @@ def seed(self, seed=None):\n         the clock otherwise.\n         \"\"\"\n         cdef rk_error errcode\n-        cdef ArrayType obj\n+        cdef ArrayType 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+            obj = <ArrayType>PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n             init_by_array(self.internal_state, <unsigned long *>(obj.data),\n                 obj.dimensions[0])\n \n@@ -314,7 +314,7 @@ def get_state(self):\n \n         get_state() -> ('MT19937', int key[624], int pos)\n         \"\"\"\n-        cdef ArrayType state\n+        cdef ArrayType state \"arrayObject_state\"\n         state = <ArrayType>_sp.empty(624, _sp.Int)\n         memcpy(<void*>(state.data), self.internal_state.key, 624*sizeof(long))\n         return ('MT19937', state, self.internal_state.pos)\n@@ -326,13 +326,13 @@ def set_state(self, state):\n         \n         set_state(state)\n         \"\"\"\n-        cdef ArrayType obj\n+        cdef ArrayType 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+        obj = <ArrayType>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, <void*>(obj.data), 624*sizeof(long))\n@@ -372,7 +372,7 @@ def randint(self, low, high=None, size=None):\n         \"\"\"\n         cdef long lo, hi, diff\n         cdef long *array_data\n-        cdef ArrayType array\n+        cdef ArrayType array \"arrayObject\"\n         cdef long length\n         cdef long i\n \n@@ -848,14 +848,14 @@ def multinomial(self, long n, object pvals, size=None):\n         as long as sum(pvals[:-1]) <= 1).\n         \"\"\"\n         cdef long d\n-        cdef ArrayType parr, mnarr\n+        cdef ArrayType 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+        parr = <ArrayType>PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n         pix = <double*>parr.data\n \n         if kahan_sum(pix, d-1) > 1.0:\n",
                "added_lines": 16,
                "deleted_lines": 16,
                "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 \"scipy.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_negative_binomial(rk_state *state, long n, double p)\n    long rk_poisson(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 scipy\nimport_array()\n\nimport scipy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n    cdef double *array_data\n    cdef ArrayType array \"arrayObject\"\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array \"arrayObject\"\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 scipy array filled with generated values\n    is returned. If size is a tuple, then a scipy 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 = <rk_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 ArrayType 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 = <ArrayType>PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n            init_by_array(self.internal_state, <unsigned long *>(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 ArrayType state \"arrayObject_state\"\n        state = <ArrayType>_sp.empty(624, _sp.Int)\n        memcpy(<void*>(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 ArrayType 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 = <ArrayType>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, <void*>(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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n            length = PyArray_SIZE(array)\n            array_data = <long *>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(<char*>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        # XXX: we really should be doing this by Cholesky decomposition\n        (u,s,v) = _sp.linalg.singular_value_decomposition(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 ArrayType 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 = <ArrayType>PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n        pix = <double*>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 = <ArrayType>multin\n        mnix = <long*>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()\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 \"scipy.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_negative_binomial(rk_state *state, long n, double p)\n    long rk_poisson(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 scipy\nimport_array()\n\nimport scipy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n    cdef double *array_data\n    cdef ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a, b)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, n, p)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType array\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state, a)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 scipy array filled with generated values\n    is returned. If size is a tuple, then a scipy 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 = <rk_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 ArrayType 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, <unsigned long *>(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 ArrayType state\n        state = <ArrayType>_sp.empty(624, _sp.Int)\n        memcpy(<void*>(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 ArrayType 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, <void*>(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 ArrayType array\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 = <ArrayType>_sp.empty(size, _sp.Int)\n            length = PyArray_SIZE(array)\n            array_data = <long *>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(<char*>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        # XXX: we really should be doing this by Cholesky decomposition\n        (u,s,v) = _sp.linalg.singular_value_decomposition(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 ArrayType parr, 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 = <double*>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 = <ArrayType>multin\n        mnix = <long*>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()\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": [
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "    cdef ArrayType array \"arrayObject\"",
                        "        cdef ArrayType obj \"arrayObject_obj\"",
                        "            obj = <ArrayType>PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)",
                        "        cdef ArrayType state \"arrayObject_state\"",
                        "        cdef ArrayType obj \"arrayObject_obj\"",
                        "        obj = <ArrayType>PyArray_ContiguousFromObject(key, PyArray_LONG, 1, 1)",
                        "        cdef ArrayType array \"arrayObject\"",
                        "        cdef ArrayType parr \"arrayObject_parr\", mnarr \"arrayObject_mnarr\"",
                        "        parr = <ArrayType>PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)"
                    ],
                    "deleted": [
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "    cdef ArrayType array",
                        "        cdef ArrayType obj",
                        "            obj = PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)",
                        "        cdef ArrayType state",
                        "        cdef ArrayType obj",
                        "        obj = PyArray_ContiguousFromObject(key, PyArray_LONG, 1, 1)",
                        "        cdef ArrayType array",
                        "        cdef ArrayType parr, mnarr",
                        "        parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)"
                    ]
                }
            }
        ]
    },
    {
        "hash": "3fd7ab7b3b7943ba7d31272a4da98bbcc4f1f588",
        "msg": "Impl. hooks to import scipy packages with info.py files.",
        "author": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "committer": {
            "name": "Pearu Peterson",
            "email": "pearu.peterson@gmail.com"
        },
        "author_date": "2005-10-14T22:37:23+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-14T22:37:23+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "d40a2d4027adf88600ae208cddc17d45efb939fa"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 6,
        "insertions": 68,
        "lines": 74,
        "files": 2,
        "dmm_unit_size": 0.0,
        "dmm_unit_complexity": 0.0,
        "dmm_unit_interfacing": 1.0,
        "modified_files": [
            {
                "old_path": "scipy/__init__.py",
                "new_path": "scipy/__init__.py",
                "filename": "__init__.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -57,4 +57,4 @@\n if show_scipy_config is not None:\n     __doc__ += __scipy_doc__\n     from _import_tools import import_packages\n-    import_packages(__path__[0])\n+    import_packages()\n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "\"\"\"\\\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\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n\n__scipy_doc__ = \"\"\"\\\nSciPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os\nif os.environ.has_key('RUNNING_FROM_SCIPY_SOURCE'):\n    print 'Running from scipy source directory.'\n    show_scipy_config = None\nelse:\n    try:\n        from __scipy_config__ import show as show_scipy_config\n    except ImportError:\n        show_scipy_config = None\n\n\nif show_scipy_config is not None:\n    __doc__ += __scipy_doc__\n    from _import_tools import import_packages\n    import_packages()\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\ntry:\n    from __core_config__ import show as show_core_config\nexcept ImportError:\n    show_core_config = None\n\nif show_core_config is None:\n    print 'Running from scipy core source directory.'\nelse:\n    from scipy.base import *\n    import scipy.basic as basic\n    from scipy.basic.fft import fft, ifft\n    from scipy.basic.random import rand, randn\n    import scipy.basic.fft as fftpack\n    import scipy.basic.linalg as linalg\n    import scipy.basic.random as random\n    from core_version import version as __core_version__\n    from scipy.test.testing import ScipyTest\n    test = ScipyTest('scipy').test\n\n__scipy_doc__ = \"\"\"\\\nSciPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os\nif os.environ.has_key('RUNNING_FROM_SCIPY_SOURCE'):\n    print 'Running from scipy source directory.'\n    show_scipy_config = None\nelse:\n    try:\n        from __scipy_config__ import show as show_scipy_config\n    except ImportError:\n        show_scipy_config = None\n\n\nif show_scipy_config is not None:\n    __doc__ += __scipy_doc__\n    from _import_tools import import_packages\n    import_packages(__path__[0])\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 54,
                "complexity": 0,
                "token_count": 154,
                "diff_parsed": {
                    "added": [
                        "    import_packages()"
                    ],
                    "deleted": [
                        "    import_packages(__path__[0])"
                    ]
                }
            },
            {
                "old_path": "scipy/_import_tools.py",
                "new_path": "scipy/_import_tools.py",
                "filename": "_import_tools.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,18 +1,80 @@\n \n import os\n+import sys\n import imp\n from glob import glob\n \n-def import_packages(rootpath):\n+def import_packages():\n     \"\"\" Import packages in the current directory that implement\n     info.py. See DEVELOPERS.txt for more info.\n     \"\"\"\n-    for info_file in glob(os.path.join(rootpath,'*','info.py')):\n+    frame = sys._getframe(1)\n+    parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n+    parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n+    info_modules = {}\n+    depend_dict = {}\n+    for info_file in glob(os.path.join(parent_path,'*','info.py')):\n          package_name = os.path.basename(os.path.dirname(info_file))\n-         print info_file,package_name\n-         continue\n+         fullname = parent_name +'.'+ package_name\n          try:\n-             info_module = imp.load_module()\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 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+         depend_dict[fullname] = getattr(info_module,'depends',[])\n+\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+    for fullname in package_names:\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',parent_name\n+            exec ('import '+package_name, frame.f_globals,frame.f_locals)\n+        except Exception,msg:\n+            print 'Failed to import',package_name\n+            print msg\n+            continue\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 'Failed to import',symbol,'from',package_name\n+                print msg\n+                continue\n+\n+        try:\n+            exec ('\\n%s.test = ScipyTest(%s).test' % (package_name,package_name),\n+                  frame.f_globals,frame.f_locals)\n+        except Exception,msg:\n+            print 'Failed to set test function for',package_name\n+            print msg        \n",
                "added_lines": 67,
                "deleted_lines": 5,
                "source_code": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\ndef import_packages():\n    \"\"\" Import packages in the current directory that implement\n    info.py. See DEVELOPERS.txt for more info.\n    \"\"\"\n    frame = sys._getframe(1)\n    parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n    parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n    info_modules = {}\n    depend_dict = {}\n    for info_file in glob(os.path.join(parent_path,'*','info.py')):\n         package_name = os.path.basename(os.path.dirname(info_file))\n         fullname = 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 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         depend_dict[fullname] = getattr(info_module,'depends',[])\n\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    for fullname in package_names:\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',parent_name\n            exec ('import '+package_name, frame.f_globals,frame.f_locals)\n        except Exception,msg:\n            print 'Failed to import',package_name\n            print msg\n            continue\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 'Failed to import',symbol,'from',package_name\n                print msg\n                continue\n\n        try:\n            exec ('\\n%s.test = ScipyTest(%s).test' % (package_name,package_name),\n                  frame.f_globals,frame.f_locals)\n        except Exception,msg:\n            print 'Failed to set test function for',package_name\n            print msg        \n",
                "source_code_before": "\nimport os\nimport imp\nfrom glob import glob\n\ndef import_packages(rootpath):\n    \"\"\" Import packages in the current directory that implement\n    info.py. See DEVELOPERS.txt for more info.\n    \"\"\"\n    for info_file in glob(os.path.join(rootpath,'*','info.py')):\n         package_name = os.path.basename(os.path.dirname(info_file))\n         print info_file,package_name\n         continue\n         try:\n             info_module = imp.load_module()\n         except Exception,msg:\n             print msg\n             info_module = None\n",
                "methods": [
                    {
                        "name": "import_packages",
                        "long_name": "import_packages( )",
                        "filename": "_import_tools.py",
                        "nloc": 62,
                        "complexity": 17,
                        "token_count": 404,
                        "parameters": [],
                        "start_line": 7,
                        "end_line": 80,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 74,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "import_packages",
                        "long_name": "import_packages( rootpath )",
                        "filename": "_import_tools.py",
                        "nloc": 10,
                        "complexity": 3,
                        "token_count": 66,
                        "parameters": [
                            "rootpath"
                        ],
                        "start_line": 6,
                        "end_line": 18,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [
                    {
                        "name": "import_packages",
                        "long_name": "import_packages( rootpath )",
                        "filename": "_import_tools.py",
                        "nloc": 10,
                        "complexity": 3,
                        "token_count": 66,
                        "parameters": [
                            "rootpath"
                        ],
                        "start_line": 6,
                        "end_line": 18,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 13,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "import_packages",
                        "long_name": "import_packages( )",
                        "filename": "_import_tools.py",
                        "nloc": 62,
                        "complexity": 17,
                        "token_count": 404,
                        "parameters": [],
                        "start_line": 7,
                        "end_line": 80,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 74,
                        "top_nesting_level": 0
                    }
                ],
                "nloc": 66,
                "complexity": 17,
                "token_count": 415,
                "diff_parsed": {
                    "added": [
                        "import sys",
                        "def import_packages():",
                        "    frame = sys._getframe(1)",
                        "    parent_name = eval('__name__',frame.f_globals,frame.f_locals)",
                        "    parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)",
                        "    info_modules = {}",
                        "    depend_dict = {}",
                        "    for info_file in glob(os.path.join(parent_path,'*','info.py')):",
                        "         fullname = parent_name +'.'+ package_name",
                        "             info_module = imp.load_module(fullname+'.info',",
                        "                                           open(info_file,'U'),",
                        "                                           info_file,",
                        "                                           ('.py','U',1))",
                        "",
                        "         if info_module is None:",
                        "             continue",
                        "         if getattr(info_module,'ignore',False):",
                        "             continue",
                        "",
                        "         info_modules[fullname] = info_module",
                        "         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",
                        "",
                        "    for fullname in package_names:",
                        "        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',parent_name",
                        "            exec ('import '+package_name, frame.f_globals,frame.f_locals)",
                        "        except Exception,msg:",
                        "            print 'Failed to import',package_name",
                        "            print msg",
                        "            continue",
                        "",
                        "        for symbol in global_symbols:",
                        "            try:",
                        "                exec ('from '+package_name+' import '+symbol,",
                        "                      frame.f_globals,frame.f_locals)",
                        "            except Exception,msg:",
                        "                print 'Failed to import',symbol,'from',package_name",
                        "                print msg",
                        "                continue",
                        "",
                        "        try:",
                        "            exec ('\\n%s.test = ScipyTest(%s).test' % (package_name,package_name),",
                        "                  frame.f_globals,frame.f_locals)",
                        "        except Exception,msg:",
                        "            print 'Failed to set test function for',package_name",
                        "            print msg"
                    ],
                    "deleted": [
                        "def import_packages(rootpath):",
                        "    for info_file in glob(os.path.join(rootpath,'*','info.py')):",
                        "         print info_file,package_name",
                        "         continue",
                        "             info_module = imp.load_module()"
                    ]
                }
            }
        ]
    },
    {
        "hash": "9ef026af05ce30c7329a021bc56a81af228588ff",
        "msg": "removed % from FMT string",
        "author": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "committer": {
            "name": "Travis Oliphant",
            "email": "oliphant@enthought.com"
        },
        "author_date": "2005-10-15T00:44:17+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-15T00:44:17+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "3fd7ab7b3b7943ba7d31272a4da98bbcc4f1f588"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 14,
        "insertions": 18,
        "lines": 32,
        "files": 4,
        "dmm_unit_size": null,
        "dmm_unit_complexity": null,
        "dmm_unit_interfacing": null,
        "modified_files": [
            {
                "old_path": "scipy/base/include/scipy/arrayobject.h",
                "new_path": "scipy/base/include/scipy/arrayobject.h",
                "filename": "arrayobject.h",
                "extension": "h",
                "change_type": "MODIFY",
                "diff": "@@ -35,19 +35,19 @@ extern \"C\" {\n typedef PY_LONG_LONG longlong;\n typedef unsigned PY_LONG_LONG ulonglong;\n #  ifdef _MSC_VER\n-#    define LONGLONG_FMT         \"%I64d\"\n-#    define ULONGLONG_FMT        \"%I64u\"\n+#    define LONGLONG_FMT         \"I64d\"\n+#    define ULONGLONG_FMT        \"I64u\"\n #    define LONGLONG_SUFFIX(x)   (x##i64)\n #    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n #  else\n-\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant\n-           #define ULONGLONG_FMT  \"%llu\"\n+\t/* #define LONGLONG_FMT   \"lld\"      Another possible variant\n+           #define ULONGLONG_FMT  \"llu\"\n \n-\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?\n-\t   #define ULONGLONG_FMT   \"%qu\"\n+\t   #define LONGLONG_FMT   \"qd\"   -- BSD perhaps?\n+\t   #define ULONGLONG_FMT   \"qu\"\n \t*/\n-#    define LONGLONG_FMT         \"%Ld\"\n-#    define ULONGLONG_FMT        \"%Lu\"\n+#    define LONGLONG_FMT         \"Ld\"\n+#    define ULONGLONG_FMT        \"Lu\"\n #    define LONGLONG_SUFFIX(x)   (x##LL)\n #    define ULONGLONG_SUFFIX(x)  (x##ULL)\n #  endif\n@@ -639,7 +639,7 @@ enum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n typedef Py_intptr_t intp;\n typedef Py_uintptr_t uintp;\n \n-#define INTP_FMT \"%d\"\n+#define INTP_FMT \"d\"\n \n #if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n \t#define PyArray_INTP PyArray_INT\n@@ -666,7 +666,7 @@ typedef Py_uintptr_t uintp;\n \t#define MIN_INTP MIN_LONGLONG\n \t#define MAX_UINTP MAX_ULONGLONG\n         #undef INTP_FMT\n-        #define INTP_FMT \"%Ld\"\n+        #define INTP_FMT \"Ld\"\n #endif\n \n #define ERR(str) fprintf(stderr, #str); fflush(stderr);\n",
                "added_lines": 10,
                "deleted_lines": 10,
                "source_code": "\n/* This expects the following variables to be defined (besides\n   the usual ones from pyconfig.h\n\n   SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no\n                         long double is present on platform.\n   CHAR_BIT       --     number of bits in a char (usually 8)\n                         (should be in limits.h)\n*/\n\n#ifndef Py_ARRAYOBJECT_H\n#define Py_ARRAYOBJECT_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"config.h\"\n\n/* There are several places in the code where an array of dimensions is */\n/* allocated statically.  This is the size of that static allocation. */\n\n#define MAX_DIMS 40\n\n/* Used for Converter Functions \"O&\" code in ParseTuple */\n#define PY_FAIL 0\n#define PY_SUCCEED 1\n\n#define NDARRAY_VERSION 0x0400\n\n\t/* Some platforms don't define bool, long long, or long double.\n\t   Handle that here.\n\t */\n\n#ifdef PY_LONG_LONG\ntypedef PY_LONG_LONG longlong;\ntypedef unsigned PY_LONG_LONG ulonglong;\n#  ifdef _MSC_VER\n#    define LONGLONG_FMT         \"I64d\"\n#    define ULONGLONG_FMT        \"I64u\"\n#    define LONGLONG_SUFFIX(x)   (x##i64)\n#    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n#  else\n\t/* #define LONGLONG_FMT   \"lld\"      Another possible variant\n           #define ULONGLONG_FMT  \"llu\"\n\n\t   #define LONGLONG_FMT   \"qd\"   -- BSD perhaps?\n\t   #define ULONGLONG_FMT   \"qu\"\n\t*/\n#    define LONGLONG_FMT         \"Ld\"\n#    define ULONGLONG_FMT        \"Lu\"\n#    define LONGLONG_SUFFIX(x)   (x##LL)\n#    define ULONGLONG_SUFFIX(x)  (x##ULL)\n#  endif\n#else\ntypedef long longlong;\ntypedef unsigned long ulonglong;\n#  define LONGLONG_SUFFIX(x)  (x##L)\n#  define ULONGLONG_SUFFIX(x) (x##UL)\n#endif\n\ntypedef unsigned char Bool;\n#ifndef FALSE\n#define FALSE 0\n#endif\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE\n\ttypedef double longdouble;\n        #define LONGDOUBLE_FMT \"g\"\n#else\n\ttypedef long double longdouble;\n        #define LONGDOUBLE_FMT \"Lg\"\n#endif\n\n#ifndef Py_USING_UNICODE\n#define Py_UNICODE char\n#endif\n\n\ntypedef signed char byte;\ntypedef unsigned char ubyte;\ntypedef unsigned short ushort;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\n\ntypedef struct { float real, imag; } cfloat;\ntypedef struct { double real, imag; } cdouble;\ntypedef struct {longdouble real, imag;} clongdouble;\n\nenum PyArray_TYPES {    PyArray_BOOL=0,\n                        PyArray_BYTE, PyArray_UBYTE,\n\t\t        PyArray_SHORT, PyArray_USHORT,\n\t\t        PyArray_INT, PyArray_UINT,\n\t\t\tPyArray_LONG, PyArray_ULONG,\n                        PyArray_LONGLONG, PyArray_ULONGLONG,\n\t\t\tPyArray_FLOAT, PyArray_DOUBLE, PyArray_LONGDOUBLE,\n\t\t\tPyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CLONGDOUBLE,\n\t\t\tPyArray_OBJECT=17,\n                        PyArray_STRING, PyArray_UNICODE,\n\t\t\tPyArray_VOID,\n\t\t\tPyArray_NTYPES,\n\t\t\tPyArray_NOTYPE,\n\t\t\tPyArray_USERDEF=256  /* leave room for characters */\n};\n\n\t/* basetype array priority */\n#define PyArray_PRIORITY 0.0\n#define PyArray_BIG_PRIORITY 0.1\n\t/* default subtype priority */\n#define PyArray_SUBTYPE_PRIORITY 1.0\n\n\t/* How many floating point types are there */\n#define PyArray_NUM_FLOATTYPE 3\n\n\n\t/* We need to match intp to a signed integer of the same size as\n\t   a pointer variable. uintp to the equivalent unsigned integer\n\t*/\n\n\n\t/* These characters correspond to the array type and the\n\t   struct module */\n\n\t/*  except 'p' -- signed integer for pointer type */\n\nenum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n\t\t\tPyArray_BYTELTR = 'b',\n\t\t\tPyArray_UBYTELTR = 'B',\n\t\t\tPyArray_SHORTLTR = 'h',\n\t\t\tPyArray_USHORTLTR = 'H',\n\t\t\tPyArray_INTLTR = 'i',\n\t\t\tPyArray_UINTLTR = 'I',\n\t\t\tPyArray_LONGLTR = 'l',\n\t\t\tPyArray_ULONGLTR = 'L',  \n\t\t\tPyArray_LONGLONGLTR = 'q',   \n\t\t\tPyArray_ULONGLONGLTR = 'Q',\n\t\t\tPyArray_FLOATLTR = 'f',\n\t\t\tPyArray_DOUBLELTR = 'd',\n\t\t\tPyArray_LONGDOUBLELTR = 'g',\n\t\t\tPyArray_CFLOATLTR = 'F',\n\t\t\tPyArray_CDOUBLELTR = 'D',\n\t\t\tPyArray_CLONGDOUBLELTR = 'G',\n\t\t\tPyArray_OBJECTLTR = 'O',\n\t\t\tPyArray_STRINGLTR = 'S',\n\t\t\tPyArray_UNICODELTR = 'U',\n\t\t        PyArray_VOIDLTR = 'V',\n\n\t\t\t/* No Descriptor, just a define -- this let's\n\t\t\t Python users specify an array of integers\n\t\t\t large enough to hold a pointer on the platform*/\n\t\t\tPyArray_INTPLTR = 'p',\n\t\t\tPyArray_UINTPLTR = 'P',\n\n\t\t\tPyArray_GENBOOLLTR ='b',\n\t\t\tPyArray_SIGNEDLTR = 'i',\n\t\t\tPyArray_UNSIGNEDLTR = 'u',\n\t\t\tPyArray_FLOATINGLTR = 'f',\n\t\t\tPyArray_COMPLEXLTR = 'c'\n};\n\n\t/* Define bit-width array types and typedefs */\n\n#define MAX_INT8 127\n#define MIN_INT8 -128\n#define MAX_UINT8 255\n#define MAX_INT16 32767\n#define MIN_INT16 -32768\n#define MAX_UINT16 65535\n#define MAX_INT32 2147483647\n#define MIN_INT32 (-MAX_INT32 - 1)\n#define MAX_UINT32 4294967295U\n#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)\n#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))\n#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)\n#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)\n#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))\n#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)\n#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)\n#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))\n#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\n\t/* Need to find the number of bits for each type and \n\t   make definitions accordingly. \n\n\t   C states that sizeof(char) == 1 by definition \n\t   \n\t   So, just using the sizeof keyword won't help.  \n\n\t   It also looks like Python itself uses sizeof(char) quite a\n\t   bit, which by definition should be 1 all the time.\n\n\t   Idea: Make Use of CHAR_BIT which should tell us how many\n\t   BITS per CHARACTER\n\t*/\n\n\t/* Include platform definitions -- These are in the C89/90 standard */\n#include <limits.h>  \n#define MAX_BYTE SCHAR_MAX\n#define MIN_BYTE SCHAR_MIN\n#define MAX_UBYTE UCHAR_MAX\n#define MAX_SHORT SHRT_MAX\n#define MIN_SHORT SHRT_MIN\n#define MAX_USHORT USHRT_MAX\n#define MAX_INT   INT_MAX\n#ifndef INT_MIN\n#define INT_MIN (-INT_MAX - 1)\n#endif\n#define MIN_INT   INT_MIN\n#define MAX_UINT  UINT_MAX\n#define MAX_LONG  LONG_MAX\n#define MIN_LONG  LONG_MIN\n#define MAX_ULONG  ULONG_MAX\n\n#define SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE\n#define SIZEOF_LONGLONG SIZEOF_LONG_LONG\n#define BITSOF_BOOL sizeof(Bool)*CHAR_BIT\n#define BITSOF_CHAR CHAR_BIT\n#define BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)\n#define BITSOF_INT (SIZEOF_INT*CHAR_BIT)\n#define BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)\n#define BITSOF_LONGLONG (SIZEOF_LONGLONG*CHAR_BIT)\n#define BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)\n#define BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)\n#define BITSOF_LONGDOUBLE (SIZEOF_LONGDOUBLE*CHAR_BIT)\n\n\n#if BITSOF_LONG == 8\n#define PyArray_INT8 PyArray_LONG\n#define PyArray_UINT8 PyArray_ULONG\n\ttypedef long Int8;\n\ttypedef unsigned long UInt8;\n#define STRBITSOF_LONG \"8\"\n#elif BITSOF_LONG == 16\n#define PyArray_INT16 PyArray_LONG\n#define PyArray_UINT16 PyArray_ULONG\n\ttypedef long Int16;\n\ttypedef unsigned long UInt16;\n#define STRBITSOF_LONG \"16\"\n#elif BITSOF_LONG == 32\n#define PyArray_INT32 PyArray_LONG\n#define PyArray_UINT32 PyArray_ULONG\n\ttypedef long Int32;\n\ttypedef unsigned long UInt32;\n#define STRBITSOF_LONG \"32\"\n#elif BITSOF_LONG == 64\n#define PyArray_INT64 PyArray_LONG\n#define PyArray_UINT64 PyArray_ULONG\n\ttypedef long Int64;\n\ttypedef unsigned long UInt64;\n#define STRBITSOF_LONG \"64\"\n#elif BITSOF_LONG == 128\n#define PyArray_INT128 PyArray_LONG\n#define PyArray_UINT128 PyArray_ULONG\n\ttypedef long Int128;\n\ttypedef unsigned long UInt128;\n#define STRBITSOF_LONG \"128\"\n#endif\n\n#if BITSOF_LONGLONG == 8\n#  ifndef PyArray_INT8\n#    define PyArray_INT8 PyArray_LONGLONG\n#    define PyArray_UINT8 PyArray_ULONGLONG\n\ttypedef longlong Int8;\n\ttypedef ulonglong UInt8;\n#  endif\n#  define MAX_LONGLONG MAX_INT8\n#  define MIN_LONGLONG MIN_INT8\n#  define MAX_ULONGLONG MAX_UINT8\n#define STRBITSOF_LONGLONG \"8\"\n#elif BITSOF_LONGLONG == 16\n#  ifndef PyArray_INT16\n#    define PyArray_INT16 PyArray_LONGLONG\n#    define PyArray_UINT16 PyArray_ULONGLONG\n\ttypedef longlong Int16;\n\ttypedef ulonglong UInt16;\n#  endif\n#  define MAX_LONGLONG MAX_INT16\n#  define MIN_LONGLONG MIN_INT16\n#  define MAX_ULONGLONG MAX_UINT16\n#define STRBITSOF_LONGLONG \"16\"\n#elif BITSOF_LONGLONG == 32\n#  ifndef PyArray_INT32\n#    define PyArray_INT32 PyArray_LONGLONG\n#    define PyArray_UINT32 PyArray_ULONGLONG\n\ttypedef longlong Int32;\n\ttypedef ulonglong UInt32;\n#  endif\n#  define MAX_LONGLONG MAX_INT32\n#  define MIN_LONGLONG MIN_INT32\n#  define MAX_ULONGLONG MAX_UINT32\n#define STRBITSOF_LONGLONG \"32\"\n#elif BITSOF_LONGLONG == 64\n#  ifndef PyArray_INT64\n#    define PyArray_INT64 PyArray_LONGLONG\n#    define PyArray_UINT64 PyArray_ULONGLONG\n\ttypedef longlong Int64;\n\ttypedef ulonglong UInt64;\n#  endif\n#  define MAX_LONGLONG MAX_INT64\n#  define MIN_LONGLONG MIN_INT64\n#  define MAX_ULONGLONG MAX_UINT64\n#define STRBITSOF_LONGLONG \"64\"\n#elif BITSOF_LONGLONG == 128\n#  ifndef PyArray_INT128\n#    define PyArray_INT128 PyArray_LONGLONG\n#    define PyArray_UINT128 PyArray_ULONGLONG\n\ttypedef longlong Int128;\n\ttypedef ulonglong UInt128;\n#  endif\n#  define MAX_LONGLONG MAX_INT128\n#  define MIN_LONGLONG MIN_INT128\n#  define MAX_ULONGLONG MAX_UINT128\n#define STRBITSOF_LONGLONG \"128\"\n#elif BITSOF_LONGLONG == 256\n#  define PyArray_INT256 PyArray_LONGLONG\n#  define PyArray_UINT256 PyArray_ULONGLONG\n\ttypedef longlong Int256;\n\ttypedef ulonglong UInt256;\n#  define MAX_LONGLONG MAX_INT256\n#  define MIN_LONGLONG MIN_INT256\n#  define MAX_ULONGLONG MAX_UINT256\n#define STRBITSOF_LONGLONG \"256\"\n#endif\n\n#if BITSOF_INT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_INT\n#define PyArray_UINT8 PyArray_UINT\n\ttypedef int Int8;\n\ttypedef unsigned int UInt8;\n#endif\n#define STRBITSOF_INT \"8\"\n#elif BITSOF_INT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_INT\n#define PyArray_UINT16 PyArray_UINT\n\ttypedef int Int16;\n\ttypedef unsigned int UInt16;\n#endif\n#define STRBITSOF_INT \"16\"\n#elif BITSOF_INT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_INT\n#define PyArray_UINT32 PyArray_UINT\n\ttypedef int Int32;\n\ttypedef unsigned int UInt32;\n#endif\n#define STRBITSOF_INT \"32\"\n#elif BITSOF_INT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_INT\n#define PyArray_UINT64 PyArray_UINT\n\ttypedef int Int64;\n\ttypedef unsigned int UInt64;\n#endif\n#define STRBITSOF_INT \"64\"\n#elif BITSOF_INT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_INT\n#define PyArray_UINT128 PyArray_UINT\n\ttypedef int Int128;\n\ttypedef unsigned int UInt128;\n#endif\n#define STRBITSOF_INT \"128\"\n#endif\n\n#if BITSOF_SHORT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_SHORT\n#define PyArray_UINT8 PyArray_USHORT\n\ttypedef short Int8;\n\ttypedef unsigned short UInt8;\n#endif\n#define STRBITSOF_SHORT \"8\"\n#elif BITSOF_SHORT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_SHORT\n#define PyArray_UINT16 PyArray_USHORT\n\ttypedef short Int16;\n\ttypedef unsigned short UInt16;\n#endif\n#define STRBITSOF_SHORT \"16\"\n#elif BITSOF_SHORT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_SHORT\n#define PyArray_UINT32 PyArray_USHORT\n\ttypedef short Int32;\n\ttypedef unsigned short UInt32;\n#endif\n#define STRBITSOF_SHORT \"32\"\n#elif BITSOF_SHORT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_SHORT\n#define PyArray_UINT64 PyArray_USHORT\n\ttypedef short Int64;\n\ttypedef unsigned short UInt64;\n#endif\n#define STRBITSOF_SHORT \"64\"\n#elif BITSOF_SHORT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_SHORT\n#define PyArray_UINT128 PyArray_USHORT\n\ttypedef short Int128;\n\ttypedef unsigned short UInt128;\n#endif\n#define STRBITSOF_SHORT \"128\"\n#endif\n\n\n#if BITSOF_CHAR == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_BYTE\n#define PyArray_UINT8 PyArray_UBYTE\n\ttypedef signed char Int8;\n\ttypedef unsigned char UInt8;\n#endif\n#define STRBITSOF_CHAR \"8\"\n#elif BITSOF_CHAR == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_BYTE\n#define PyArray_UINT16 PyArray_UBYTE\n\ttypedef signed char Int16;\n\ttypedef unsigned char UInt16;\n#endif\n#define STRBITSOF_CHAR \"16\"\n#elif BITSOF_CHAR == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_BYTE\n#define PyArray_UINT32 PyArray_UBYTE\n\ttypedef signed char Int32;\n\ttypedef unsigned char UInt32;\n#endif\n#define STRBITSOF_CHAR \"32\"\n#elif BITSOF_CHAR == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_BYTE\n#define PyArray_UINT64 PyArray_UBYTE\n\ttypedef signed char Int64;\n\ttypedef unsigned char UInt64;\n#endif\n#define STRBITSOF_CHAR \"64\"\n#elif BITSOF_CHAR == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_BYTE\n#define PyArray_UINT128 PyArray_UBYTE\n\ttypedef signed char Int128;\n\ttypedef unsigned char UInt128;\n#endif\n#define STRBITSOF_CHAR \"128\"\n#endif\n\n\n\n#if BITSOF_DOUBLE == 16\n#define STRBITSOF_DOUBLE \"16\"\n#define STRBITSOF_CDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_DOUBLE\n#define PyArray_COMPLEX32 PyArray_CDOUBLE\n\ttypedef  double Float16;\n\ttypedef cdouble Complex32;\n#endif\n#elif BITSOF_DOUBLE == 32\n#define STRBITSOF_DOUBLE \"32\"\n#define STRBITSOF_CDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_DOUBLE\n#define PyArray_COMPLEX64 PyArray_CDOUBLE\n\ttypedef double Float32;\n\ttypedef cdouble Complex64;\n#endif\n#elif BITSOF_DOUBLE == 64\n#define STRBITSOF_DOUBLE \"64\"\n#define STRBITSOF_CDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_DOUBLE\n#define PyArray_COMPLEX128 PyArray_CDOUBLE\n\ttypedef double Float64;\n\ttypedef cdouble Complex128;\n#endif\n#elif BITSOF_DOUBLE == 80\n#define STRBITSOF_DOUBLE \"80\"\n#define STRBITSOF_CDOUBLE \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_DOUBLE\n#define PyArray_COMPLEX160 PyArray_CDOUBLE\n\ttypedef double Float80\n\ttypedef cdouble Complex160\n#endif\n#elif BITSOF_DOUBLE == 96\n#define STRBITSOF_DOUBLE \"96\"\n#define STRBITSOF_CDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_DOUBLE\n#define PyArray_COMPLEX192 PyArray_CDOUBLE\n\ttypedef double Float96;\n\ttypedef cdouble Complex192;\n#endif\n#elif BITSOF_DOUBLE == 128\n#define STRBITSOF_DOUBLE \"128\"\n#define STRBITSOF_CDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_DOUBLE\n#define PyArray_COMPLEX256 PyArray_CDOUBLE\n\ttypedef double Float128;\n\ttypedef cdouble Complex256;\n#endif\n#endif\n\n\n\n#if BITSOF_FLOAT == 16\n#define STRBITSOF_FLOAT \"16\"\n#define STRBITSOF_CFLOAT \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_FLOAT\n#define PyArray_COMPLEX32 PyArray_CFLOAT\n\ttypedef float Float16;\n\ttypedef cfloat Complex32;\n#endif\n#elif BITSOF_FLOAT == 32\n#define STRBITSOF_FLOAT \"32\"\n#define STRBITSOF_CFLOAT \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_FLOAT\n#define PyArray_COMPLEX64 PyArray_CFLOAT\n\ttypedef float Float32;\n\ttypedef cfloat Complex64;\n#endif\n#elif BITSOF_FLOAT == 64\n#define STRBITSOF_FLOAT \"64\"\n#define STRBITSOF_CFLOAT \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_FLOAT\n#define PyArray_COMPLEX128 PyArray_CFLOAT\n\ttypedef float Float64;\n\ttypedef cfloat Complex128;\n#endif\n#elif BITSOF_FLOAT == 80\n#define STRBITSOF_FLOAT \"80\"\n#define STRBITSOF_CFLOAT \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_FLOAT\n#define PyArray_COMPLEX160 PyArray_CFLOAT\n\ttypedef float Float80\n\ttypedef cfloat Complex160\n#endif\n#elif BITSOF_FLOAT == 96\n#define STRBITSOF_FLOAT \"96\"\n#define STRBITSOF_CFLOAT \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_FLOAT\n#define PyArray_COMPLEX192 PyArray_CFLOAT\n\ttypedef float Float96;\n\ttypedef cfloat Complex192;\n#endif\n#elif BITSOF_FLOAT == 128\n#define STRBITSOF_FLOAT \"128\"\n#define STRBITSOF_CFLOAT \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_FLOAT\n#define PyArray_COMPLEX256 PyArray_CFLOAT\n\ttypedef float Float128;\n\ttypedef cfloat Complex256;\n#endif\n#endif\n\n\n#if BITSOF_LONGDOUBLE == 16\n#define STRBITSOF_LONGDOUBLE \"16\"\n#define STRBITSOF_CLONGDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX32 PyArray_CLONGDOUBLE\n\ttypedef  longdouble Float16;\n\ttypedef clongdouble Complex32;\n#endif\n#elif BITSOF_LONGDOUBLE == 32\n#define STRBITSOF_LONGDOUBLE \"32\"\n#define STRBITSOF_CLONGDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX64 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float32;\n\ttypedef clongdouble Complex64;\n#endif\n#elif BITSOF_LONGDOUBLE == 64\n#define STRBITSOF_LONGDOUBLE \"64\"\n#define STRBITSOF_CLONGDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX128 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float64;\n\ttypedef clongdouble Complex128;\n#endif\n#elif BITSOF_LONGDOUBLE == 80\n#define STRBITSOF_LONGDOUBLE \"80\"\n#define STRBITSOF_CLONGDOUBLE \"160\" \n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX160 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float80\n\ttypedef clongdouble Complex160\n#endif\n#elif BITSOF_LONGDOUBLE == 96\n#define STRBITSOF_LONGDOUBLE \"96\"\n#define STRBITSOF_CLONGDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX192 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float96;\n\ttypedef clongdouble Complex192;\n#endif\n#elif BITSOF_LONGDOUBLE == 128\n#define STRBITSOF_LONGDOUBLE \"128\"\n#define STRBITSOF_CLONGDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX256 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float128;\n\ttypedef clongdouble Complex256;\n#endif\n#elif BITSOF_LONGDOUBLE == 256\n#define STRBITSOF_LONGDOUBLE \"256\"\n#define STRBITSOF_CLONGDOUBLE \"512\"\n#define PyArray_FLOAT256 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX512 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float256;\n\ttypedef clongdouble Complex512;\n#endif\n\n\n\t/* End of typedefs for numarray style bit-width names */\n\n/* This is to typedef Intp to the appropriate pointer size for this platform.\n * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */\ntypedef Py_intptr_t intp;\ntypedef Py_uintptr_t uintp;\n\n#define INTP_FMT \"d\"\n\n#if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n\t#define PyArray_INTP PyArray_INT\n\t#define PyArray_UINTP PyArray_UINT\n        #define PyIntpArrType_Type PyIntArrType_Type\n        #define PyUIntpArrType_Type PyUIntArrType_Type\n\t#define MAX_INTP MAX_INT\n\t#define MIN_INTP MIN_INT\n\t#define MAX_UINTP MAX_UINT\n#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG\n\t#define PyArray_INTP PyArray_LONG\n\t#define PyArray_UINTP PyArray_ULONG\n        #define PyIntpArrType_Type PyLongArrType_Type\n        #define PyUIntpArrType_Type PyULongArrType_Type\n\t#define MAX_INTP MAX_LONG\n\t#define MIN_INTP MIN_LONG\n\t#define MAX_UINTP MAX_ULONG\n#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)\n\t#define PyArray_INTP PyArray_LONGLONG\n\t#define PyArray_UINTP PyArray_ULONGLONG\n        #define PyIntpArrType_Type PyLongLongArrType_Type\n        #define PyUIntpArrType_Type PyULongLongArrType_Type\n\t#define MAX_INTP MAX_LONGLONG\n\t#define MIN_INTP MIN_LONGLONG\n\t#define MAX_UINTP MAX_ULONGLONG\n        #undef INTP_FMT\n        #define INTP_FMT \"Ld\"\n#endif\n\n#define ERR(str) fprintf(stderr, #str); fflush(stderr);\n#define ERR2(str) fprintf(stderr, str); fflush(stderr);\n\n  /* Macros to define how array, and dimension/strides data is\n     allocated. \n  */\n\n  /* Data buffer */\n#define PyDataMem_NEW(size) ((char *)malloc(size))\n  /* #define PyArrayMem_NEW(size) PyMem_NEW(char, size)*/\n#define PyDataMem_FREE(ptr)  free(ptr)\n  /* #define PyArrayMem_FREE(ptr) PyMem_Free(ptr) */\n#define PyDataMem_RENEW(ptr,size) ((char *)realloc(ptr,size))\n\n  /* Dimensions and strides */\n#define PyDimMem_NEW(size) ((intp *)malloc(size*sizeof(intp)))\n#define PyDimMem_FREE(ptr) free(ptr)\n#define PyDimMem_RENEW(ptr,size) ((intp *)realloc(ptr,size*sizeof(intp)))\n\n\n  /* These must deal with unaligned and unbyteswapped data if necessary */\ntypedef PyObject * (PyArray_GetItemFunc) (char *, void *);\ntypedef int (PyArray_SetItemFunc)(PyObject *, char *, void *);\n\ntypedef int (PyArray_CompareFunc)(const void *, const void *, void *);\ntypedef void (PyArray_CopySwapNFunc)(void *, void *, intp, int, int);\ntypedef void (PyArray_CopySwapFunc)(void *, void *, int, int);\ntypedef Bool (PyArray_NonzeroFunc)(void *, void *);\n\n\n  /* These assume aligned and byteswapped data -- a buffer will be\n      used before or contiguous data will be obtained\n  */\ntypedef int (PyArray_ArgFunc)(void*, intp, intp*, void *);\ntypedef void (PyArray_DotFunc)(char *, intp, char *, intp, char *, intp, \n\t\t\t       void *);\ntypedef void (PyArray_VectorUnaryFunc)(void *, void *, intp, void *, void *);\ntypedef int (PyArray_ScanFunc)(FILE *, void *, int, char *, void *);\n\n\ntypedef struct {\n \tPyTypeObject *typeobj;  /* the type object for this type */\n\tchar kind;              /* kind for this type */\n\tchar type;              /* character representing this type */\n\tint type_num;           /* number representing this type */\n\tint elsize;             /* element size for this type -- \n\t\t\t\t   or 0 if variable */\n       \tint alignment;          /* alignment needed for this type */\n\n\t/* Functions to cast to all other standard types*/\n\tPyArray_VectorUnaryFunc *cast[PyArray_NTYPES];\n\n\t/* Functions to get and set items with standard\n\t   Python types -- not array scalars */\n\tPyArray_GetItemFunc *getitem;\n\tPyArray_SetItemFunc *setitem;\n\n\t/* Function to compare items */\n\tPyArray_CompareFunc *compare;\n\n  \t/* Function to select largest */\n\tPyArray_ArgFunc *argmax;\n\n\t/* Function to compute dot product */\n\tPyArray_DotFunc\t*dotfunc;\t   \n\t\n\t/* Function to scan an ASCII file and \n\t   place a single value plus possible separator */\n\tPyArray_ScanFunc *scanfunc;\n\n\t/* Copy and/or swap data.  Memory areas may not overlap */\n\t/*  Use memmove first if they might */\n\tPyArray_CopySwapNFunc *copyswapn;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\t/* Function to determine if data is zero or not */\n\tPyArray_NonzeroFunc *nonzero;\n\n} PyArray_Descr;\n\n\ntypedef struct PyArrayObject {\n\tPyObject_HEAD\n\tchar *data;             /* pointer to raw data buffer */\n\tint nd;                 /* number of dimensions, also called ndim */ \n\tintp *dimensions;       /* size in each dimension */\n        intp *strides;          /* bytes to jump to get to the \n\t\t\t\t   next element in each dimension */\n\tPyObject *base;         /* This object should be decref'd\n\t\t\t\t   upon deletion of array */\n\t                        /* For views it points to the original array */\n\t                        /* For creation from buffer object it points \n\t\t\t\t   to an object that shold be decref'd on \n\t\t\t\t   deletion */\n\t                        /* For UPDATEIFCOPY flag this is an array \n\t\t\t\t   to-be-updated upon deletion of this one */\n\tPyArray_Descr *descr;   /* Pointer to type structure */\n\tint flags;              /* Flags describing array -- see below*/\n\tint itemsize;           /* needed for Flexible size arrays:\n                                   CHAR, UNICODE, and VOID arrays\n \t\t\t         */ \n\tPyObject *weakreflist;  /* For weakreferences */\n\n} PyArrayObject;\n\n#define fortran fortran_  /* For some compilers */\n\ntypedef struct {   /* Just the type_num and itemsize variables \n\t\t      for use in the TypeNum Converter function */\n\tint type_num;\n\tint itemsize;\n\tint fortran;  /* Set to 1 if fortran-defined strides is desired */\n} PyArray_Typecode;\n\ntypedef struct {\n        intp *ptr;\n        int len;\n} PyArray_Dims;\n\n\n/* Mirrors buffer object to ptr */\n\ntypedef struct {\n        PyObject_HEAD\n        PyObject *base;\n        void *ptr;\n        intp len;\n        int flags;        \n} PyArray_Chunk;\n\n/* Array flags */\n#define CONTIGUOUS     1      /* means c-style contiguous (last index\n\t\t\t       varies the fastest) data elements right\n\t\t\t      after each other. */\n\n\t                      /* All 0-d arrays are CONTIGUOUS and FORTRAN\n\t\t\t\t contiguous.  If a 1-d array is CONTIGUOUS\n\t\t\t\t it is also FORTRAN contiguous \n\t\t\t      */\n\n#define FORTRAN    2    /* set if array is a contiguous Fortran array */\n                       /*  first index varies the fastest in memory\n                           (strides array is reverse of C-contiguous\n\t\t\t           array)*/\n\n#define OWNDATA        4\n#define OWN_DATA       OWNDATA\n\n\t/* array never has these three set -- FromAny flags only */\n#define FORCECAST     0x010    \n#define ENSURECOPY    0x020\n#define ENSUREARRAY   0x040\n\n#define ALIGNED       0x100\n#define NOTSWAPPED    0x200\n#define WRITEABLE     0x400\n\n\n\t/* If this flags is set, then base contains a pointer to \n\t   an array of the same size that should be updated with the \n\t   current contents of this array when this array is deallocated\n\t*/\n#define UPDATEIFCOPY  0x1000\n\n\n/* Size of internal buffers used for alignment */\n#define PyArray_BUFSIZE 10000\n#define PyArray_MIN_BUFSIZE 5\n#define PyArray_MAX_BUFSIZE 100000000\n\n#define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n#define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n#define CARRAY_FLAGS CONTIGUOUS | BEHAVED_FLAGS\n#define FARRAY_FLAGS FORTRAN | BEHAVED_FLAGS\n#define DEFAULT_FLAGS CARRAY_FLAGS\n\n#define UPDATE_ALL_FLAGS CONTIGUOUS | FORTRAN | ALIGNED\n\n\n/*\n * C API:  consists of Macros and functions.  The MACROS are defined here. \n */\n\n\n#define PyArray_CHKFLAGS(m, FLAGS) \\\n\t((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))\n#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, CONTIGUOUS)\n#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, WRITEABLE)\n\n#define PyArray_ISCARRAY(m) PyArray_CHKFLAGS(m, CARRAY_FLAGS)\n#define PyArray_ISFARRAY(m) PyArray_CHKFLAGS(m, FARRAY_FLAGS)\n#define PyArray_ISBEHAVED(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS)\n#define PyArray_ISBEHAVED_RO(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS_RO)\n\n\n#ifndef MAX\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#endif\n#ifndef MIN\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#endif\n\n        /* Useful if a and b have to be evaluated.  */\n\n#define tMAX(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_>_y_ ? _x_ : _y_}\n#define tMIN(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_<_y_ ? _x_ : _y_}\n\n#if defined(ALLOW_THREADS)\n#define BEGIN_THREADS_DEF PyThreadState *_save;\n#define BEGIN_THREADS _save = PyEval_SaveThread();\n#define END_THREADS   PyEval_RestoreThread(_save);\n#define ALLOW_C_API_DEF  PyGILState_STATE __save__;\n#define ALLOW_C_API      __save__ = PyGILState_Ensure();\n#define DISABLE_C_API    PyGILState_Release(__save__);\n#else\n#define BEGIN_THREADS_DEF\n#define BEGIN_THREADS\n#define END_THREADS\n#define ALLOW_C_API_DEF\n#define\tALLOW_C_API    \n#define\tDISABLE_C_API  \n#endif\n\ntypedef struct {\n        PyObject_HEAD\n\tint                     nd_m1;            /* number of dimensions - 1 */\n        intp\t\t        index, size;\n\tintp                    coordinates[MAX_DIMS];/* N-dimensional loop */\n        intp                    dims_m1[MAX_DIMS];    /* ao->dimensions - 1 */\n\tintp                    strides[MAX_DIMS];    /* ao->strides or fake */\n\tintp                    backstrides[MAX_DIMS];/* how far to jump back */\n\tintp                    factors[MAX_DIMS];     /* shape factors */\n\tPyArrayObject           *ao;\n\tchar                    *dataptr;        /* pointer to current item*/\n        unsigned char           contiguous;\n} PyArrayIterObject;\n\n\n/* Iterator API */ \n#define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type)\n\t\n#define PyArray_ITER_RESET(it) {\t\t\t\t\t\\\n\tit->index = 0;\t\t\t\t\t\t        \\\n\tit->dataptr = it->ao->data;\t\t\t\t\t\\\n\tmemset(it->coordinates, 0, (it->nd_m1+1)*sizeof(intp));\t\t\\\n}\n\n\n#define PyArray_ITER_NEXT(it) {\t\t\t\t\\\n\tit->index++;\t\t\t\t\t\\\n\tif (it->contiguous)  it->dataptr += it->ao->itemsize;\t       \\\n\telse {\t\t\t\t\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_ >= 0; _i_--) {\t\t\\\n\t\t\tif (it->coordinates[_i_] <\t\t\t\\\n\t\t\t    it->dims_m1[_i_]) {\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_]++;\t\t\t\\\n\t\t\t\tit->dataptr += it->strides[_i_];\t\\\n\t\t\t\tbreak;\t\t\t\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t\telse {\t\t\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_] = 0;\t\t\\\n\t\t\t\tit->dataptr -= it->backstrides[_i_];\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n}\n\n#define PyArray_ITER_GOTO(it, destination) {\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tit->index = 0;\t\t\t\t\t\t\\\n\t\tit->dataptr = it->ao->data;\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_>=0; _i_--) {\t\t\t\\\n\t\t\tit->dataptr += destination[_i_] *\t\t\\\n\t\t\t\tit->strides[_i_];\t\t\t\\\n\t\t\tit->coordinates[_i_] = destination[_i_];\t\\\n\t\t\tit->index += destination[_i_] *\t\t\t\\\n\t\t\t\t( _i_==it->nd_m1 ? 1 :\t\t\t\\\n\t\t\t\t  it->dims_m1[i+1]+1) ;\t  \t        \\\n\t\t}\t\t\t\t\t\t\t\\\n\t} \n\n#define PyArray_ITER_GOTO1D(it, ind) {                                  \\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tintp _lind_ = (intp) (ind);\t\t\t\t\\\n\t\tit->index = _lind_;\t\t\t\t\t\\\n\t\tif (it->contiguous)\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data + (ind) *\t\t\\\n\t\t\t\tit->ao->itemsize;\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data;\t\t\t\\\n\t\t\tfor (_i_ = 0; _i_<=it->nd_m1; _i_++) {\t\t\\\n\t\t\t\tit->dataptr += (_lind_ / it->factors[_i_]) \\\n\t\t\t\t\t* it->strides[_i_];\t\t\\\n\t\t\t\t_lind_ %= it->factors[_i_];\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n}\n\n/* Not constructed anywhere.  Just serves as a standard type that\n   PyArray_Broadcast expects.\n\n   Any object passed to PyArray_Broadcast must be binary compatible with \n   this structure.    \n*/\n\n\ntypedef struct {\n\tPyObject_HEAD\n\n\tint                     numiter;               /* number of iters */\n\tintp                    size;                  /* broadcasted size */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* iterators */\n} PyArrayMultiIterObject;  \n\t\n\n/* Store the information needed for fancy-indexing over an array */\n\ntypedef struct {\n\tPyObject_HEAD\n\t/* Multi-iterator portion --- needs to be present in this order to \n\t   work with PyArray_Broadcast */\n\n\tint                     numiter;               /* number of index-array\n\t\t\t\t\t\t\t  iterators */\n\tintp                    size;                  /* size of broadcasted \n\t\t\t\t\t\t\t  result */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* index object \n\t\t\t\t\t\t\t  iterators */\n\tPyArrayIterObject       *ait;                   /* flat Iterator for \n\t\t\t\t\t\t\t  underlying array */\n\n\t/* flat iterator for subspace (when numiter < nd) */\n\tPyArrayIterObject       *subspace;\n\n\t/* if subspace iteration, then this is the array of \n\t   axes in the underlying array represented by the\n\t   index objects */\n\tint                     iteraxes[MAX_DIMS];\n\t/* if subspace iteration, the these are the coordinates\n\t   to the start of the subspace.\n\t*/\n\tintp                    bscoord[MAX_DIMS];\n\n\t\n\tPyObject                *indexobj;             /* reference to \n\t\t\t\t\t\t\t  creating obj */\n\tint                     view;\n\tint                     consec;\n\tchar                    *dataptr;\n\n} PyArrayMapIterObject;\n\n\n/* Map Iterator API */ \n#define PyArrayMapIter_Check(op) PyObject_TypeCheck(op, &PyArrayMapIter_Type)\n\n\n#define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd)\n#define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, CONTIGUOUS) || \\\n\t\t\t\t PyArray_CHKFLAGS(m, FORTRAN))\n#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, FORTRAN) && (PyArray_NDIM(m) > 1))\n#define PyArray_DATA(obj) (((PyArrayObject *)(obj))->data)\n#define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions)\n#define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides)\n#define PyArray_DIM(obj,n) (((PyArrayObject *)(obj))->dimensions[n])\n#define PyArray_STRIDE(obj,n) (((PyArrayObject *)(obj))->strides[n])\n#define PyArray_BASE(obj) (((PyArrayObject *)(obj))->base)\n#define PyArray_DESCR(obj) (((PyArrayObject *)(obj))->descr)\n#define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags)\n#define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->itemsize)\n#define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num)\n#define PyArray_GETITEM(obj,itemptr)\t\t\t\\\n\t((PyArrayObject *)(obj))->descr->getitem((char *)itemptr,\t\\\n\t\t\t\t\t\t (PyArrayObject *)obj);\n#define PyArray_SETITEM(obj,itemptr,v)\t\t\t\t\t\\\n\t(obj)->descr->setitem((PyObject *)v,(char *)(itemptr),\t\t\\\n\t\t\t      (PyArrayObject *)(obj));\n\n\n#define PyTypeNum_ISBOOL(type) (type == PyArray_BOOL)\n#define PyTypeNum_ISUNSIGNED(type) ((type == PyArray_UBYTE) || \\\n\t\t\t\t (type == PyArray_USHORT) || \\\n\t\t\t\t (type == PyArray_UINT) ||\t\\\n\t\t\t\t (type == PyArray_ULONG) || \\\n\t\t\t\t (type == PyArray_ULONGLONG))\n\n#define PyTypeNum_ISSIGNED(type) ((type == PyArray_BYTE) ||\t\\\n\t\t\t       (type == PyArray_SHORT) ||\t\\\n\t\t\t       (type == PyArray_INT) ||\t\\\n\t\t\t       (type == PyArray_LONG) ||\t\\\n\t\t\t       (type == PyArray_LONGLONG))\n\n#define PyTypeNum_ISINTEGER(type) ((type >= PyArray_BYTE) &&\t\\\n\t\t\t\t(type <= PyArray_ULONGLONG))\n       \n#define PyTypeNum_ISFLOAT(type) ((type >= PyArray_FLOAT) &&  \\\n\t\t\t      (type <= PyArray_LONGDOUBLE))\n\n#define PyTypeNum_ISNUMBER(type) (type <= PyArray_CLONGDOUBLE)\n\n#define PyTypeNum_ISSTRING(type) ((type == PyArray_UCHAR) || \\\n\t\t\t       (type == PyArray_UNICODE))\n\n#define PyTypeNum_ISCOMPLEX(type) ((type >= PyArray_CFLOAT) && \\\n\t\t\t\t(type <= PyArray_CLONGDOUBLE))\n\t\n#define PyTypeNum_ISPYTHON(type) ((type == PyArray_LONG) || \\\n\t\t\t\t  (type == PyArray_DOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_CDOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_OBJECT ))\n\n#define PyTypeNum_ISFLEXIBLE(type) ((type==PyArray_STRING) || \\\n\t\t\t\t    (type==PyArray_UNICODE) ||\t\\\n\t\t\t\t    (type==PyArray_VOID))\n\n#define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \\\n\t\t\t\t   (type < PyArray_USERDEF+\\\n\t\t\t\t    PyArray_NUMUSERTYPES))\n\n#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) &&   \\\n\t\t\t\t     (type <= PyArray_VOID)) ||\t   \\\n\t\t\t\t    (type >= PyArray_USERDEF))\n\t\t\t\t    \n#define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT)\n\n#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))\n#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))\n#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))\n#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n#define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj))\n#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))\n\n/* Object arrays ignore notswapped flag */\n#define PyArray_ISNOTSWAPPED(m) (PyArray_CHKFLAGS(m, NOTSWAPPED) || \\\n\t\t\t\t PyArray_ISOBJECT(m))\n\n\n  /*  Often, rather than always convert to an array, \n      we may want to delegate behavior for other objects passed in\n  */\n\n\t/* \n\n#define Py_DELEGATE(op, name)                                     \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, NULL);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS(op, name, args)\t\t\t  \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, args);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS_KWDS(op, name, args, kwds)\t          \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_Call(meth, args, kwds);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\t*/\n\n\n        /* Includes the \"function\" C-API -- these are all stored in a \n\t   list of pointers --- one for each file\n\t   The two lists are concatenated into one in multiarray.\n\t   \n\t   They are available as import_array()\n         */\n\n#include \"__multiarray_api.h\"\n\n\n        /* C-API that requries previous API to be defined */\n\n#define PyArray_Check(op) (PyObject_TypeCheck((op), &PyBigArray_Type))\n#define PyBigArray_CheckExact(op) ((op)->ob_type == &PyBigArray_Type)\n#define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type)\n\n#define PyArray_CheckScalar(m) (PyObject_TypeCheck((m),\t\t\t\\\n\t\t\t\t\t\t   &PyGenericArrType_Type) \\\n\t\t\t\t|| ((PyArray_Check((m))) &&\t\t\\\n\t\t\t\t    (((PyArrayObject *)(m))->nd == 0)))\n#define PyArray_IsScalar(obj, cls)\t\t\t\t\\\n\t(PyObject_TypeCheck((obj), &Py##cls##ArrType_Type))\n#define PyArray_IsPythonScalar(obj) \\\n\t(PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \\\n\t PyLong_Check(obj) || PyBool_Check(obj) || PyString_Check(obj) || \\\n\t PyUnicode_Check(obj))\n#define PyArray_IsAnyScalar(obj) \\\n\t(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))\n\n#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \\\n\t  (PyArrayObject *)(PyArray_ContiguousFromObject((PyObject *)(m), \\\n\t\t                      PyArray_TYPE(m), 0, 0))) \n\n#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))\n#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))\n#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0)\n#define PyArray_FROM_OF(m,flags) PyArray_FromAny(m, NULL, 0, 0, flags)\n\n#define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)\n#define MAX_ELSIZE 2*SIZEOF_LONGDOUBLE\n\n#define PyArray_SimpleNew(nd, dims, typenum) \\\n\tPyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)\n\n        /*Compatibility with old Numeric stuff -- don't use in new code */\n\n#define PyArray_UNSIGNED_TYPES\n#define PyArray_SBYTE PyArray_BYTE\n#define PyArray_CHAR PyArray_BYTE\n#define PyArray_CopyArray PyArray_CopyInto\n#define _PyArray_multiply_list PyArray_MultiplyIntList\n#define PyArray_ISSPACESAVER(m) FALSE\n#define PyScalarArray_Check PyArray_CheckScalar\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !Py_ARRAYOBJECT_H */\n",
                "source_code_before": "\n/* This expects the following variables to be defined (besides\n   the usual ones from pyconfig.h\n\n   SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no\n                         long double is present on platform.\n   CHAR_BIT       --     number of bits in a char (usually 8)\n                         (should be in limits.h)\n*/\n\n#ifndef Py_ARRAYOBJECT_H\n#define Py_ARRAYOBJECT_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"config.h\"\n\n/* There are several places in the code where an array of dimensions is */\n/* allocated statically.  This is the size of that static allocation. */\n\n#define MAX_DIMS 40\n\n/* Used for Converter Functions \"O&\" code in ParseTuple */\n#define PY_FAIL 0\n#define PY_SUCCEED 1\n\n#define NDARRAY_VERSION 0x0400\n\n\t/* Some platforms don't define bool, long long, or long double.\n\t   Handle that here.\n\t */\n\n#ifdef PY_LONG_LONG\ntypedef PY_LONG_LONG longlong;\ntypedef unsigned PY_LONG_LONG ulonglong;\n#  ifdef _MSC_VER\n#    define LONGLONG_FMT         \"%I64d\"\n#    define ULONGLONG_FMT        \"%I64u\"\n#    define LONGLONG_SUFFIX(x)   (x##i64)\n#    define ULONGLONG_SUFFIX(x)  (x##Ui64)\n#  else\n\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant\n           #define ULONGLONG_FMT  \"%llu\"\n\n\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?\n\t   #define ULONGLONG_FMT   \"%qu\"\n\t*/\n#    define LONGLONG_FMT         \"%Ld\"\n#    define ULONGLONG_FMT        \"%Lu\"\n#    define LONGLONG_SUFFIX(x)   (x##LL)\n#    define ULONGLONG_SUFFIX(x)  (x##ULL)\n#  endif\n#else\ntypedef long longlong;\ntypedef unsigned long ulonglong;\n#  define LONGLONG_SUFFIX(x)  (x##L)\n#  define ULONGLONG_SUFFIX(x) (x##UL)\n#endif\n\ntypedef unsigned char Bool;\n#ifndef FALSE\n#define FALSE 0\n#endif\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#if SIZEOF_LONG_DOUBLE==SIZEOF_DOUBLE\n\ttypedef double longdouble;\n        #define LONGDOUBLE_FMT \"g\"\n#else\n\ttypedef long double longdouble;\n        #define LONGDOUBLE_FMT \"Lg\"\n#endif\n\n#ifndef Py_USING_UNICODE\n#define Py_UNICODE char\n#endif\n\n\ntypedef signed char byte;\ntypedef unsigned char ubyte;\ntypedef unsigned short ushort;\ntypedef unsigned int uint;\ntypedef unsigned long ulong;\n\ntypedef struct { float real, imag; } cfloat;\ntypedef struct { double real, imag; } cdouble;\ntypedef struct {longdouble real, imag;} clongdouble;\n\nenum PyArray_TYPES {    PyArray_BOOL=0,\n                        PyArray_BYTE, PyArray_UBYTE,\n\t\t        PyArray_SHORT, PyArray_USHORT,\n\t\t        PyArray_INT, PyArray_UINT,\n\t\t\tPyArray_LONG, PyArray_ULONG,\n                        PyArray_LONGLONG, PyArray_ULONGLONG,\n\t\t\tPyArray_FLOAT, PyArray_DOUBLE, PyArray_LONGDOUBLE,\n\t\t\tPyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CLONGDOUBLE,\n\t\t\tPyArray_OBJECT=17,\n                        PyArray_STRING, PyArray_UNICODE,\n\t\t\tPyArray_VOID,\n\t\t\tPyArray_NTYPES,\n\t\t\tPyArray_NOTYPE,\n\t\t\tPyArray_USERDEF=256  /* leave room for characters */\n};\n\n\t/* basetype array priority */\n#define PyArray_PRIORITY 0.0\n#define PyArray_BIG_PRIORITY 0.1\n\t/* default subtype priority */\n#define PyArray_SUBTYPE_PRIORITY 1.0\n\n\t/* How many floating point types are there */\n#define PyArray_NUM_FLOATTYPE 3\n\n\n\t/* We need to match intp to a signed integer of the same size as\n\t   a pointer variable. uintp to the equivalent unsigned integer\n\t*/\n\n\n\t/* These characters correspond to the array type and the\n\t   struct module */\n\n\t/*  except 'p' -- signed integer for pointer type */\n\nenum PyArray_TYPECHAR { PyArray_BOOLLTR = '?',\n\t\t\tPyArray_BYTELTR = 'b',\n\t\t\tPyArray_UBYTELTR = 'B',\n\t\t\tPyArray_SHORTLTR = 'h',\n\t\t\tPyArray_USHORTLTR = 'H',\n\t\t\tPyArray_INTLTR = 'i',\n\t\t\tPyArray_UINTLTR = 'I',\n\t\t\tPyArray_LONGLTR = 'l',\n\t\t\tPyArray_ULONGLTR = 'L',  \n\t\t\tPyArray_LONGLONGLTR = 'q',   \n\t\t\tPyArray_ULONGLONGLTR = 'Q',\n\t\t\tPyArray_FLOATLTR = 'f',\n\t\t\tPyArray_DOUBLELTR = 'd',\n\t\t\tPyArray_LONGDOUBLELTR = 'g',\n\t\t\tPyArray_CFLOATLTR = 'F',\n\t\t\tPyArray_CDOUBLELTR = 'D',\n\t\t\tPyArray_CLONGDOUBLELTR = 'G',\n\t\t\tPyArray_OBJECTLTR = 'O',\n\t\t\tPyArray_STRINGLTR = 'S',\n\t\t\tPyArray_UNICODELTR = 'U',\n\t\t        PyArray_VOIDLTR = 'V',\n\n\t\t\t/* No Descriptor, just a define -- this let's\n\t\t\t Python users specify an array of integers\n\t\t\t large enough to hold a pointer on the platform*/\n\t\t\tPyArray_INTPLTR = 'p',\n\t\t\tPyArray_UINTPLTR = 'P',\n\n\t\t\tPyArray_GENBOOLLTR ='b',\n\t\t\tPyArray_SIGNEDLTR = 'i',\n\t\t\tPyArray_UNSIGNEDLTR = 'u',\n\t\t\tPyArray_FLOATINGLTR = 'f',\n\t\t\tPyArray_COMPLEXLTR = 'c'\n};\n\n\t/* Define bit-width array types and typedefs */\n\n#define MAX_INT8 127\n#define MIN_INT8 -128\n#define MAX_UINT8 255\n#define MAX_INT16 32767\n#define MIN_INT16 -32768\n#define MAX_UINT16 65535\n#define MAX_INT32 2147483647\n#define MIN_INT32 (-MAX_INT32 - 1)\n#define MAX_UINT32 4294967295U\n#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)\n#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))\n#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)\n#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)\n#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))\n#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)\n#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)\n#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))\n#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\n\t/* Need to find the number of bits for each type and \n\t   make definitions accordingly. \n\n\t   C states that sizeof(char) == 1 by definition \n\t   \n\t   So, just using the sizeof keyword won't help.  \n\n\t   It also looks like Python itself uses sizeof(char) quite a\n\t   bit, which by definition should be 1 all the time.\n\n\t   Idea: Make Use of CHAR_BIT which should tell us how many\n\t   BITS per CHARACTER\n\t*/\n\n\t/* Include platform definitions -- These are in the C89/90 standard */\n#include <limits.h>  \n#define MAX_BYTE SCHAR_MAX\n#define MIN_BYTE SCHAR_MIN\n#define MAX_UBYTE UCHAR_MAX\n#define MAX_SHORT SHRT_MAX\n#define MIN_SHORT SHRT_MIN\n#define MAX_USHORT USHRT_MAX\n#define MAX_INT   INT_MAX\n#ifndef INT_MIN\n#define INT_MIN (-INT_MAX - 1)\n#endif\n#define MIN_INT   INT_MIN\n#define MAX_UINT  UINT_MAX\n#define MAX_LONG  LONG_MAX\n#define MIN_LONG  LONG_MIN\n#define MAX_ULONG  ULONG_MAX\n\n#define SIZEOF_LONGDOUBLE SIZEOF_LONG_DOUBLE\n#define SIZEOF_LONGLONG SIZEOF_LONG_LONG\n#define BITSOF_BOOL sizeof(Bool)*CHAR_BIT\n#define BITSOF_CHAR CHAR_BIT\n#define BITSOF_SHORT (SIZEOF_SHORT*CHAR_BIT)\n#define BITSOF_INT (SIZEOF_INT*CHAR_BIT)\n#define BITSOF_LONG (SIZEOF_LONG*CHAR_BIT)\n#define BITSOF_LONGLONG (SIZEOF_LONGLONG*CHAR_BIT)\n#define BITSOF_FLOAT (SIZEOF_FLOAT*CHAR_BIT)\n#define BITSOF_DOUBLE (SIZEOF_DOUBLE*CHAR_BIT)\n#define BITSOF_LONGDOUBLE (SIZEOF_LONGDOUBLE*CHAR_BIT)\n\n\n#if BITSOF_LONG == 8\n#define PyArray_INT8 PyArray_LONG\n#define PyArray_UINT8 PyArray_ULONG\n\ttypedef long Int8;\n\ttypedef unsigned long UInt8;\n#define STRBITSOF_LONG \"8\"\n#elif BITSOF_LONG == 16\n#define PyArray_INT16 PyArray_LONG\n#define PyArray_UINT16 PyArray_ULONG\n\ttypedef long Int16;\n\ttypedef unsigned long UInt16;\n#define STRBITSOF_LONG \"16\"\n#elif BITSOF_LONG == 32\n#define PyArray_INT32 PyArray_LONG\n#define PyArray_UINT32 PyArray_ULONG\n\ttypedef long Int32;\n\ttypedef unsigned long UInt32;\n#define STRBITSOF_LONG \"32\"\n#elif BITSOF_LONG == 64\n#define PyArray_INT64 PyArray_LONG\n#define PyArray_UINT64 PyArray_ULONG\n\ttypedef long Int64;\n\ttypedef unsigned long UInt64;\n#define STRBITSOF_LONG \"64\"\n#elif BITSOF_LONG == 128\n#define PyArray_INT128 PyArray_LONG\n#define PyArray_UINT128 PyArray_ULONG\n\ttypedef long Int128;\n\ttypedef unsigned long UInt128;\n#define STRBITSOF_LONG \"128\"\n#endif\n\n#if BITSOF_LONGLONG == 8\n#  ifndef PyArray_INT8\n#    define PyArray_INT8 PyArray_LONGLONG\n#    define PyArray_UINT8 PyArray_ULONGLONG\n\ttypedef longlong Int8;\n\ttypedef ulonglong UInt8;\n#  endif\n#  define MAX_LONGLONG MAX_INT8\n#  define MIN_LONGLONG MIN_INT8\n#  define MAX_ULONGLONG MAX_UINT8\n#define STRBITSOF_LONGLONG \"8\"\n#elif BITSOF_LONGLONG == 16\n#  ifndef PyArray_INT16\n#    define PyArray_INT16 PyArray_LONGLONG\n#    define PyArray_UINT16 PyArray_ULONGLONG\n\ttypedef longlong Int16;\n\ttypedef ulonglong UInt16;\n#  endif\n#  define MAX_LONGLONG MAX_INT16\n#  define MIN_LONGLONG MIN_INT16\n#  define MAX_ULONGLONG MAX_UINT16\n#define STRBITSOF_LONGLONG \"16\"\n#elif BITSOF_LONGLONG == 32\n#  ifndef PyArray_INT32\n#    define PyArray_INT32 PyArray_LONGLONG\n#    define PyArray_UINT32 PyArray_ULONGLONG\n\ttypedef longlong Int32;\n\ttypedef ulonglong UInt32;\n#  endif\n#  define MAX_LONGLONG MAX_INT32\n#  define MIN_LONGLONG MIN_INT32\n#  define MAX_ULONGLONG MAX_UINT32\n#define STRBITSOF_LONGLONG \"32\"\n#elif BITSOF_LONGLONG == 64\n#  ifndef PyArray_INT64\n#    define PyArray_INT64 PyArray_LONGLONG\n#    define PyArray_UINT64 PyArray_ULONGLONG\n\ttypedef longlong Int64;\n\ttypedef ulonglong UInt64;\n#  endif\n#  define MAX_LONGLONG MAX_INT64\n#  define MIN_LONGLONG MIN_INT64\n#  define MAX_ULONGLONG MAX_UINT64\n#define STRBITSOF_LONGLONG \"64\"\n#elif BITSOF_LONGLONG == 128\n#  ifndef PyArray_INT128\n#    define PyArray_INT128 PyArray_LONGLONG\n#    define PyArray_UINT128 PyArray_ULONGLONG\n\ttypedef longlong Int128;\n\ttypedef ulonglong UInt128;\n#  endif\n#  define MAX_LONGLONG MAX_INT128\n#  define MIN_LONGLONG MIN_INT128\n#  define MAX_ULONGLONG MAX_UINT128\n#define STRBITSOF_LONGLONG \"128\"\n#elif BITSOF_LONGLONG == 256\n#  define PyArray_INT256 PyArray_LONGLONG\n#  define PyArray_UINT256 PyArray_ULONGLONG\n\ttypedef longlong Int256;\n\ttypedef ulonglong UInt256;\n#  define MAX_LONGLONG MAX_INT256\n#  define MIN_LONGLONG MIN_INT256\n#  define MAX_ULONGLONG MAX_UINT256\n#define STRBITSOF_LONGLONG \"256\"\n#endif\n\n#if BITSOF_INT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_INT\n#define PyArray_UINT8 PyArray_UINT\n\ttypedef int Int8;\n\ttypedef unsigned int UInt8;\n#endif\n#define STRBITSOF_INT \"8\"\n#elif BITSOF_INT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_INT\n#define PyArray_UINT16 PyArray_UINT\n\ttypedef int Int16;\n\ttypedef unsigned int UInt16;\n#endif\n#define STRBITSOF_INT \"16\"\n#elif BITSOF_INT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_INT\n#define PyArray_UINT32 PyArray_UINT\n\ttypedef int Int32;\n\ttypedef unsigned int UInt32;\n#endif\n#define STRBITSOF_INT \"32\"\n#elif BITSOF_INT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_INT\n#define PyArray_UINT64 PyArray_UINT\n\ttypedef int Int64;\n\ttypedef unsigned int UInt64;\n#endif\n#define STRBITSOF_INT \"64\"\n#elif BITSOF_INT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_INT\n#define PyArray_UINT128 PyArray_UINT\n\ttypedef int Int128;\n\ttypedef unsigned int UInt128;\n#endif\n#define STRBITSOF_INT \"128\"\n#endif\n\n#if BITSOF_SHORT == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_SHORT\n#define PyArray_UINT8 PyArray_USHORT\n\ttypedef short Int8;\n\ttypedef unsigned short UInt8;\n#endif\n#define STRBITSOF_SHORT \"8\"\n#elif BITSOF_SHORT == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_SHORT\n#define PyArray_UINT16 PyArray_USHORT\n\ttypedef short Int16;\n\ttypedef unsigned short UInt16;\n#endif\n#define STRBITSOF_SHORT \"16\"\n#elif BITSOF_SHORT == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_SHORT\n#define PyArray_UINT32 PyArray_USHORT\n\ttypedef short Int32;\n\ttypedef unsigned short UInt32;\n#endif\n#define STRBITSOF_SHORT \"32\"\n#elif BITSOF_SHORT == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_SHORT\n#define PyArray_UINT64 PyArray_USHORT\n\ttypedef short Int64;\n\ttypedef unsigned short UInt64;\n#endif\n#define STRBITSOF_SHORT \"64\"\n#elif BITSOF_SHORT == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_SHORT\n#define PyArray_UINT128 PyArray_USHORT\n\ttypedef short Int128;\n\ttypedef unsigned short UInt128;\n#endif\n#define STRBITSOF_SHORT \"128\"\n#endif\n\n\n#if BITSOF_CHAR == 8\n#ifndef PyArray_INT8\n#define PyArray_INT8 PyArray_BYTE\n#define PyArray_UINT8 PyArray_UBYTE\n\ttypedef signed char Int8;\n\ttypedef unsigned char UInt8;\n#endif\n#define STRBITSOF_CHAR \"8\"\n#elif BITSOF_CHAR == 16\n#ifndef PyArray_INT16\n#define PyArray_INT16 PyArray_BYTE\n#define PyArray_UINT16 PyArray_UBYTE\n\ttypedef signed char Int16;\n\ttypedef unsigned char UInt16;\n#endif\n#define STRBITSOF_CHAR \"16\"\n#elif BITSOF_CHAR == 32\n#ifndef PyArray_INT32\n#define PyArray_INT32 PyArray_BYTE\n#define PyArray_UINT32 PyArray_UBYTE\n\ttypedef signed char Int32;\n\ttypedef unsigned char UInt32;\n#endif\n#define STRBITSOF_CHAR \"32\"\n#elif BITSOF_CHAR == 64\n#ifndef PyArray_INT64\n#define PyArray_INT64 PyArray_BYTE\n#define PyArray_UINT64 PyArray_UBYTE\n\ttypedef signed char Int64;\n\ttypedef unsigned char UInt64;\n#endif\n#define STRBITSOF_CHAR \"64\"\n#elif BITSOF_CHAR == 128\n#ifndef PyArray_INT128\n#define PyArray_INT128 PyArray_BYTE\n#define PyArray_UINT128 PyArray_UBYTE\n\ttypedef signed char Int128;\n\ttypedef unsigned char UInt128;\n#endif\n#define STRBITSOF_CHAR \"128\"\n#endif\n\n\n\n#if BITSOF_DOUBLE == 16\n#define STRBITSOF_DOUBLE \"16\"\n#define STRBITSOF_CDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_DOUBLE\n#define PyArray_COMPLEX32 PyArray_CDOUBLE\n\ttypedef  double Float16;\n\ttypedef cdouble Complex32;\n#endif\n#elif BITSOF_DOUBLE == 32\n#define STRBITSOF_DOUBLE \"32\"\n#define STRBITSOF_CDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_DOUBLE\n#define PyArray_COMPLEX64 PyArray_CDOUBLE\n\ttypedef double Float32;\n\ttypedef cdouble Complex64;\n#endif\n#elif BITSOF_DOUBLE == 64\n#define STRBITSOF_DOUBLE \"64\"\n#define STRBITSOF_CDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_DOUBLE\n#define PyArray_COMPLEX128 PyArray_CDOUBLE\n\ttypedef double Float64;\n\ttypedef cdouble Complex128;\n#endif\n#elif BITSOF_DOUBLE == 80\n#define STRBITSOF_DOUBLE \"80\"\n#define STRBITSOF_CDOUBLE \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_DOUBLE\n#define PyArray_COMPLEX160 PyArray_CDOUBLE\n\ttypedef double Float80\n\ttypedef cdouble Complex160\n#endif\n#elif BITSOF_DOUBLE == 96\n#define STRBITSOF_DOUBLE \"96\"\n#define STRBITSOF_CDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_DOUBLE\n#define PyArray_COMPLEX192 PyArray_CDOUBLE\n\ttypedef double Float96;\n\ttypedef cdouble Complex192;\n#endif\n#elif BITSOF_DOUBLE == 128\n#define STRBITSOF_DOUBLE \"128\"\n#define STRBITSOF_CDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_DOUBLE\n#define PyArray_COMPLEX256 PyArray_CDOUBLE\n\ttypedef double Float128;\n\ttypedef cdouble Complex256;\n#endif\n#endif\n\n\n\n#if BITSOF_FLOAT == 16\n#define STRBITSOF_FLOAT \"16\"\n#define STRBITSOF_CFLOAT \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_FLOAT\n#define PyArray_COMPLEX32 PyArray_CFLOAT\n\ttypedef float Float16;\n\ttypedef cfloat Complex32;\n#endif\n#elif BITSOF_FLOAT == 32\n#define STRBITSOF_FLOAT \"32\"\n#define STRBITSOF_CFLOAT \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_FLOAT\n#define PyArray_COMPLEX64 PyArray_CFLOAT\n\ttypedef float Float32;\n\ttypedef cfloat Complex64;\n#endif\n#elif BITSOF_FLOAT == 64\n#define STRBITSOF_FLOAT \"64\"\n#define STRBITSOF_CFLOAT \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_FLOAT\n#define PyArray_COMPLEX128 PyArray_CFLOAT\n\ttypedef float Float64;\n\ttypedef cfloat Complex128;\n#endif\n#elif BITSOF_FLOAT == 80\n#define STRBITSOF_FLOAT \"80\"\n#define STRBITSOF_CFLOAT \"160\"\n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_FLOAT\n#define PyArray_COMPLEX160 PyArray_CFLOAT\n\ttypedef float Float80\n\ttypedef cfloat Complex160\n#endif\n#elif BITSOF_FLOAT == 96\n#define STRBITSOF_FLOAT \"96\"\n#define STRBITSOF_CFLOAT \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_FLOAT\n#define PyArray_COMPLEX192 PyArray_CFLOAT\n\ttypedef float Float96;\n\ttypedef cfloat Complex192;\n#endif\n#elif BITSOF_FLOAT == 128\n#define STRBITSOF_FLOAT \"128\"\n#define STRBITSOF_CFLOAT \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_FLOAT\n#define PyArray_COMPLEX256 PyArray_CFLOAT\n\ttypedef float Float128;\n\ttypedef cfloat Complex256;\n#endif\n#endif\n\n\n#if BITSOF_LONGDOUBLE == 16\n#define STRBITSOF_LONGDOUBLE \"16\"\n#define STRBITSOF_CLONGDOUBLE \"32\"\n#ifndef PyArray_FLOAT16\n#define PyArray_FLOAT16 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX32 PyArray_CLONGDOUBLE\n\ttypedef  longdouble Float16;\n\ttypedef clongdouble Complex32;\n#endif\n#elif BITSOF_LONGDOUBLE == 32\n#define STRBITSOF_LONGDOUBLE \"32\"\n#define STRBITSOF_CLONGDOUBLE \"64\"\n#ifndef PyArray_FLOAT32\n#define PyArray_FLOAT32 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX64 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float32;\n\ttypedef clongdouble Complex64;\n#endif\n#elif BITSOF_LONGDOUBLE == 64\n#define STRBITSOF_LONGDOUBLE \"64\"\n#define STRBITSOF_CLONGDOUBLE \"128\"\n#ifndef PyArray_FLOAT64\n#define PyArray_FLOAT64 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX128 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float64;\n\ttypedef clongdouble Complex128;\n#endif\n#elif BITSOF_LONGDOUBLE == 80\n#define STRBITSOF_LONGDOUBLE \"80\"\n#define STRBITSOF_CLONGDOUBLE \"160\" \n#ifndef PyArray_FLOAT80\n#define PyArray_FLOAT80 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX160 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float80\n\ttypedef clongdouble Complex160\n#endif\n#elif BITSOF_LONGDOUBLE == 96\n#define STRBITSOF_LONGDOUBLE \"96\"\n#define STRBITSOF_CLONGDOUBLE \"192\"\n#ifndef PyArray_FLOAT96\n#define PyArray_FLOAT96 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX192 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float96;\n\ttypedef clongdouble Complex192;\n#endif\n#elif BITSOF_LONGDOUBLE == 128\n#define STRBITSOF_LONGDOUBLE \"128\"\n#define STRBITSOF_CLONGDOUBLE \"256\"\n#ifndef PyArray_FLOAT128\n#define PyArray_FLOAT128 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX256 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float128;\n\ttypedef clongdouble Complex256;\n#endif\n#elif BITSOF_LONGDOUBLE == 256\n#define STRBITSOF_LONGDOUBLE \"256\"\n#define STRBITSOF_CLONGDOUBLE \"512\"\n#define PyArray_FLOAT256 PyArray_LONGDOUBLE\n#define PyArray_COMPLEX512 PyArray_CLONGDOUBLE\n\ttypedef longdouble Float256;\n\ttypedef clongdouble Complex512;\n#endif\n\n\n\t/* End of typedefs for numarray style bit-width names */\n\n/* This is to typedef Intp to the appropriate pointer size for this platform.\n * Py_intptr_t, Py_uintptr_t are defined in pyport.h. */\ntypedef Py_intptr_t intp;\ntypedef Py_uintptr_t uintp;\n\n#define INTP_FMT \"%d\"\n\n#if SIZEOF_PY_INTPTR_T == SIZEOF_INT  \n\t#define PyArray_INTP PyArray_INT\n\t#define PyArray_UINTP PyArray_UINT\n        #define PyIntpArrType_Type PyIntArrType_Type\n        #define PyUIntpArrType_Type PyUIntArrType_Type\n\t#define MAX_INTP MAX_INT\n\t#define MIN_INTP MIN_INT\n\t#define MAX_UINTP MAX_UINT\n#elif SIZEOF_PY_INTPTR_T == SIZEOF_LONG\n\t#define PyArray_INTP PyArray_LONG\n\t#define PyArray_UINTP PyArray_ULONG\n        #define PyIntpArrType_Type PyLongArrType_Type\n        #define PyUIntpArrType_Type PyULongArrType_Type\n\t#define MAX_INTP MAX_LONG\n\t#define MIN_INTP MIN_LONG\n\t#define MAX_UINTP MAX_ULONG\n#elif defined(PY_LONG_LONG) && (SIZEOF_PY_INTPTR_T == SIZEOF_LONG_LONG)\n\t#define PyArray_INTP PyArray_LONGLONG\n\t#define PyArray_UINTP PyArray_ULONGLONG\n        #define PyIntpArrType_Type PyLongLongArrType_Type\n        #define PyUIntpArrType_Type PyULongLongArrType_Type\n\t#define MAX_INTP MAX_LONGLONG\n\t#define MIN_INTP MIN_LONGLONG\n\t#define MAX_UINTP MAX_ULONGLONG\n        #undef INTP_FMT\n        #define INTP_FMT \"%Ld\"\n#endif\n\n#define ERR(str) fprintf(stderr, #str); fflush(stderr);\n#define ERR2(str) fprintf(stderr, str); fflush(stderr);\n\n  /* Macros to define how array, and dimension/strides data is\n     allocated. \n  */\n\n  /* Data buffer */\n#define PyDataMem_NEW(size) ((char *)malloc(size))\n  /* #define PyArrayMem_NEW(size) PyMem_NEW(char, size)*/\n#define PyDataMem_FREE(ptr)  free(ptr)\n  /* #define PyArrayMem_FREE(ptr) PyMem_Free(ptr) */\n#define PyDataMem_RENEW(ptr,size) ((char *)realloc(ptr,size))\n\n  /* Dimensions and strides */\n#define PyDimMem_NEW(size) ((intp *)malloc(size*sizeof(intp)))\n#define PyDimMem_FREE(ptr) free(ptr)\n#define PyDimMem_RENEW(ptr,size) ((intp *)realloc(ptr,size*sizeof(intp)))\n\n\n  /* These must deal with unaligned and unbyteswapped data if necessary */\ntypedef PyObject * (PyArray_GetItemFunc) (char *, void *);\ntypedef int (PyArray_SetItemFunc)(PyObject *, char *, void *);\n\ntypedef int (PyArray_CompareFunc)(const void *, const void *, void *);\ntypedef void (PyArray_CopySwapNFunc)(void *, void *, intp, int, int);\ntypedef void (PyArray_CopySwapFunc)(void *, void *, int, int);\ntypedef Bool (PyArray_NonzeroFunc)(void *, void *);\n\n\n  /* These assume aligned and byteswapped data -- a buffer will be\n      used before or contiguous data will be obtained\n  */\ntypedef int (PyArray_ArgFunc)(void*, intp, intp*, void *);\ntypedef void (PyArray_DotFunc)(char *, intp, char *, intp, char *, intp, \n\t\t\t       void *);\ntypedef void (PyArray_VectorUnaryFunc)(void *, void *, intp, void *, void *);\ntypedef int (PyArray_ScanFunc)(FILE *, void *, int, char *, void *);\n\n\ntypedef struct {\n \tPyTypeObject *typeobj;  /* the type object for this type */\n\tchar kind;              /* kind for this type */\n\tchar type;              /* character representing this type */\n\tint type_num;           /* number representing this type */\n\tint elsize;             /* element size for this type -- \n\t\t\t\t   or 0 if variable */\n       \tint alignment;          /* alignment needed for this type */\n\n\t/* Functions to cast to all other standard types*/\n\tPyArray_VectorUnaryFunc *cast[PyArray_NTYPES];\n\n\t/* Functions to get and set items with standard\n\t   Python types -- not array scalars */\n\tPyArray_GetItemFunc *getitem;\n\tPyArray_SetItemFunc *setitem;\n\n\t/* Function to compare items */\n\tPyArray_CompareFunc *compare;\n\n  \t/* Function to select largest */\n\tPyArray_ArgFunc *argmax;\n\n\t/* Function to compute dot product */\n\tPyArray_DotFunc\t*dotfunc;\t   \n\t\n\t/* Function to scan an ASCII file and \n\t   place a single value plus possible separator */\n\tPyArray_ScanFunc *scanfunc;\n\n\t/* Copy and/or swap data.  Memory areas may not overlap */\n\t/*  Use memmove first if they might */\n\tPyArray_CopySwapNFunc *copyswapn;\n        PyArray_CopySwapFunc *copyswap;\n\t\n\t/* Function to determine if data is zero or not */\n\tPyArray_NonzeroFunc *nonzero;\n\n} PyArray_Descr;\n\n\ntypedef struct PyArrayObject {\n\tPyObject_HEAD\n\tchar *data;             /* pointer to raw data buffer */\n\tint nd;                 /* number of dimensions, also called ndim */ \n\tintp *dimensions;       /* size in each dimension */\n        intp *strides;          /* bytes to jump to get to the \n\t\t\t\t   next element in each dimension */\n\tPyObject *base;         /* This object should be decref'd\n\t\t\t\t   upon deletion of array */\n\t                        /* For views it points to the original array */\n\t                        /* For creation from buffer object it points \n\t\t\t\t   to an object that shold be decref'd on \n\t\t\t\t   deletion */\n\t                        /* For UPDATEIFCOPY flag this is an array \n\t\t\t\t   to-be-updated upon deletion of this one */\n\tPyArray_Descr *descr;   /* Pointer to type structure */\n\tint flags;              /* Flags describing array -- see below*/\n\tint itemsize;           /* needed for Flexible size arrays:\n                                   CHAR, UNICODE, and VOID arrays\n \t\t\t         */ \n\tPyObject *weakreflist;  /* For weakreferences */\n\n} PyArrayObject;\n\n#define fortran fortran_  /* For some compilers */\n\ntypedef struct {   /* Just the type_num and itemsize variables \n\t\t      for use in the TypeNum Converter function */\n\tint type_num;\n\tint itemsize;\n\tint fortran;  /* Set to 1 if fortran-defined strides is desired */\n} PyArray_Typecode;\n\ntypedef struct {\n        intp *ptr;\n        int len;\n} PyArray_Dims;\n\n\n/* Mirrors buffer object to ptr */\n\ntypedef struct {\n        PyObject_HEAD\n        PyObject *base;\n        void *ptr;\n        intp len;\n        int flags;        \n} PyArray_Chunk;\n\n/* Array flags */\n#define CONTIGUOUS     1      /* means c-style contiguous (last index\n\t\t\t       varies the fastest) data elements right\n\t\t\t      after each other. */\n\n\t                      /* All 0-d arrays are CONTIGUOUS and FORTRAN\n\t\t\t\t contiguous.  If a 1-d array is CONTIGUOUS\n\t\t\t\t it is also FORTRAN contiguous \n\t\t\t      */\n\n#define FORTRAN    2    /* set if array is a contiguous Fortran array */\n                       /*  first index varies the fastest in memory\n                           (strides array is reverse of C-contiguous\n\t\t\t           array)*/\n\n#define OWNDATA        4\n#define OWN_DATA       OWNDATA\n\n\t/* array never has these three set -- FromAny flags only */\n#define FORCECAST     0x010    \n#define ENSURECOPY    0x020\n#define ENSUREARRAY   0x040\n\n#define ALIGNED       0x100\n#define NOTSWAPPED    0x200\n#define WRITEABLE     0x400\n\n\n\t/* If this flags is set, then base contains a pointer to \n\t   an array of the same size that should be updated with the \n\t   current contents of this array when this array is deallocated\n\t*/\n#define UPDATEIFCOPY  0x1000\n\n\n/* Size of internal buffers used for alignment */\n#define PyArray_BUFSIZE 10000\n#define PyArray_MIN_BUFSIZE 5\n#define PyArray_MAX_BUFSIZE 100000000\n\n#define BEHAVED_FLAGS ALIGNED | NOTSWAPPED | WRITEABLE\n#define BEHAVED_FLAGS_RO ALIGNED | NOTSWAPPED\n#define CARRAY_FLAGS CONTIGUOUS | BEHAVED_FLAGS\n#define FARRAY_FLAGS FORTRAN | BEHAVED_FLAGS\n#define DEFAULT_FLAGS CARRAY_FLAGS\n\n#define UPDATE_ALL_FLAGS CONTIGUOUS | FORTRAN | ALIGNED\n\n\n/*\n * C API:  consists of Macros and functions.  The MACROS are defined here. \n */\n\n\n#define PyArray_CHKFLAGS(m, FLAGS) \\\n\t((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))\n#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS(m, CONTIGUOUS)\n#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS(m, WRITEABLE)\n\n#define PyArray_ISCARRAY(m) PyArray_CHKFLAGS(m, CARRAY_FLAGS)\n#define PyArray_ISFARRAY(m) PyArray_CHKFLAGS(m, FARRAY_FLAGS)\n#define PyArray_ISBEHAVED(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS)\n#define PyArray_ISBEHAVED_RO(m) PyArray_CHKFLAGS(m, BEHAVED_FLAGS_RO)\n\n\n#ifndef MAX\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#endif\n#ifndef MIN\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#endif\n\n        /* Useful if a and b have to be evaluated.  */\n\n#define tMAX(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_>_y_ ? _x_ : _y_}\n#define tMIN(a,b,typ) {typ _x_=(a); typ _y_=(b); _x_<_y_ ? _x_ : _y_}\n\n#if defined(ALLOW_THREADS)\n#define BEGIN_THREADS_DEF PyThreadState *_save;\n#define BEGIN_THREADS _save = PyEval_SaveThread();\n#define END_THREADS   PyEval_RestoreThread(_save);\n#define ALLOW_C_API_DEF  PyGILState_STATE __save__;\n#define ALLOW_C_API      __save__ = PyGILState_Ensure();\n#define DISABLE_C_API    PyGILState_Release(__save__);\n#else\n#define BEGIN_THREADS_DEF\n#define BEGIN_THREADS\n#define END_THREADS\n#define ALLOW_C_API_DEF\n#define\tALLOW_C_API    \n#define\tDISABLE_C_API  \n#endif\n\ntypedef struct {\n        PyObject_HEAD\n\tint                     nd_m1;            /* number of dimensions - 1 */\n        intp\t\t        index, size;\n\tintp                    coordinates[MAX_DIMS];/* N-dimensional loop */\n        intp                    dims_m1[MAX_DIMS];    /* ao->dimensions - 1 */\n\tintp                    strides[MAX_DIMS];    /* ao->strides or fake */\n\tintp                    backstrides[MAX_DIMS];/* how far to jump back */\n\tintp                    factors[MAX_DIMS];     /* shape factors */\n\tPyArrayObject           *ao;\n\tchar                    *dataptr;        /* pointer to current item*/\n        unsigned char           contiguous;\n} PyArrayIterObject;\n\n\n/* Iterator API */ \n#define PyArrayIter_Check(op) PyObject_TypeCheck(op, &PyArrayIter_Type)\n\t\n#define PyArray_ITER_RESET(it) {\t\t\t\t\t\\\n\tit->index = 0;\t\t\t\t\t\t        \\\n\tit->dataptr = it->ao->data;\t\t\t\t\t\\\n\tmemset(it->coordinates, 0, (it->nd_m1+1)*sizeof(intp));\t\t\\\n}\n\n\n#define PyArray_ITER_NEXT(it) {\t\t\t\t\\\n\tit->index++;\t\t\t\t\t\\\n\tif (it->contiguous)  it->dataptr += it->ao->itemsize;\t       \\\n\telse {\t\t\t\t\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_ >= 0; _i_--) {\t\t\\\n\t\t\tif (it->coordinates[_i_] <\t\t\t\\\n\t\t\t    it->dims_m1[_i_]) {\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_]++;\t\t\t\\\n\t\t\t\tit->dataptr += it->strides[_i_];\t\\\n\t\t\t\tbreak;\t\t\t\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t\telse {\t\t\t\t\t\t\\\n\t\t\t\tit->coordinates[_i_] = 0;\t\t\\\n\t\t\t\tit->dataptr -= it->backstrides[_i_];\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n}\n\n#define PyArray_ITER_GOTO(it, destination) {\t\t\t\t\\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tit->index = 0;\t\t\t\t\t\t\\\n\t\tit->dataptr = it->ao->data;\t\t\t\t\\\n\t\tfor (_i_ = it->nd_m1; _i_>=0; _i_--) {\t\t\t\\\n\t\t\tit->dataptr += destination[_i_] *\t\t\\\n\t\t\t\tit->strides[_i_];\t\t\t\\\n\t\t\tit->coordinates[_i_] = destination[_i_];\t\\\n\t\t\tit->index += destination[_i_] *\t\t\t\\\n\t\t\t\t( _i_==it->nd_m1 ? 1 :\t\t\t\\\n\t\t\t\t  it->dims_m1[i+1]+1) ;\t  \t        \\\n\t\t}\t\t\t\t\t\t\t\\\n\t} \n\n#define PyArray_ITER_GOTO1D(it, ind) {                                  \\\n\t\tint _i_;\t\t\t\t\t\t\\\n\t\tintp _lind_ = (intp) (ind);\t\t\t\t\\\n\t\tit->index = _lind_;\t\t\t\t\t\\\n\t\tif (it->contiguous)\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data + (ind) *\t\t\\\n\t\t\t\tit->ao->itemsize;\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tit->dataptr = it->ao->data;\t\t\t\\\n\t\t\tfor (_i_ = 0; _i_<=it->nd_m1; _i_++) {\t\t\\\n\t\t\t\tit->dataptr += (_lind_ / it->factors[_i_]) \\\n\t\t\t\t\t* it->strides[_i_];\t\t\\\n\t\t\t\t_lind_ %= it->factors[_i_];\t\t\\\n\t\t\t}\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n}\n\n/* Not constructed anywhere.  Just serves as a standard type that\n   PyArray_Broadcast expects.\n\n   Any object passed to PyArray_Broadcast must be binary compatible with \n   this structure.    \n*/\n\n\ntypedef struct {\n\tPyObject_HEAD\n\n\tint                     numiter;               /* number of iters */\n\tintp                    size;                  /* broadcasted size */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* iterators */\n} PyArrayMultiIterObject;  \n\t\n\n/* Store the information needed for fancy-indexing over an array */\n\ntypedef struct {\n\tPyObject_HEAD\n\t/* Multi-iterator portion --- needs to be present in this order to \n\t   work with PyArray_Broadcast */\n\n\tint                     numiter;               /* number of index-array\n\t\t\t\t\t\t\t  iterators */\n\tintp                    size;                  /* size of broadcasted \n\t\t\t\t\t\t\t  result */\n\tintp                    index;                 /* current index */\n\tint                     nd;                    /* number of dims */\n\tintp                    dimensions[MAX_DIMS];  /* dimensions */\n\tPyArrayIterObject       *iters[MAX_DIMS];      /* index object \n\t\t\t\t\t\t\t  iterators */\n\tPyArrayIterObject       *ait;                   /* flat Iterator for \n\t\t\t\t\t\t\t  underlying array */\n\n\t/* flat iterator for subspace (when numiter < nd) */\n\tPyArrayIterObject       *subspace;\n\n\t/* if subspace iteration, then this is the array of \n\t   axes in the underlying array represented by the\n\t   index objects */\n\tint                     iteraxes[MAX_DIMS];\n\t/* if subspace iteration, the these are the coordinates\n\t   to the start of the subspace.\n\t*/\n\tintp                    bscoord[MAX_DIMS];\n\n\t\n\tPyObject                *indexobj;             /* reference to \n\t\t\t\t\t\t\t  creating obj */\n\tint                     view;\n\tint                     consec;\n\tchar                    *dataptr;\n\n} PyArrayMapIterObject;\n\n\n/* Map Iterator API */ \n#define PyArrayMapIter_Check(op) PyObject_TypeCheck(op, &PyArrayMapIter_Type)\n\n\n#define PyArray_NDIM(obj) (((PyArrayObject *)(obj))->nd)\n#define PyArray_ISONESEGMENT(m) (PyArray_NDIM(m) == 0 || PyArray_CHKFLAGS(m, CONTIGUOUS) || \\\n\t\t\t\t PyArray_CHKFLAGS(m, FORTRAN))\n#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, FORTRAN) && (PyArray_NDIM(m) > 1))\n#define PyArray_DATA(obj) (((PyArrayObject *)(obj))->data)\n#define PyArray_DIMS(obj) (((PyArrayObject *)(obj))->dimensions)\n#define PyArray_STRIDES(obj) (((PyArrayObject *)(obj))->strides)\n#define PyArray_DIM(obj,n) (((PyArrayObject *)(obj))->dimensions[n])\n#define PyArray_STRIDE(obj,n) (((PyArrayObject *)(obj))->strides[n])\n#define PyArray_BASE(obj) (((PyArrayObject *)(obj))->base)\n#define PyArray_DESCR(obj) (((PyArrayObject *)(obj))->descr)\n#define PyArray_FLAGS(obj) (((PyArrayObject *)(obj))->flags)\n#define PyArray_ITEMSIZE(obj) (((PyArrayObject *)(obj))->itemsize)\n#define PyArray_TYPE(obj) (((PyArrayObject *)(obj))->descr->type_num)\n#define PyArray_GETITEM(obj,itemptr)\t\t\t\\\n\t((PyArrayObject *)(obj))->descr->getitem((char *)itemptr,\t\\\n\t\t\t\t\t\t (PyArrayObject *)obj);\n#define PyArray_SETITEM(obj,itemptr,v)\t\t\t\t\t\\\n\t(obj)->descr->setitem((PyObject *)v,(char *)(itemptr),\t\t\\\n\t\t\t      (PyArrayObject *)(obj));\n\n\n#define PyTypeNum_ISBOOL(type) (type == PyArray_BOOL)\n#define PyTypeNum_ISUNSIGNED(type) ((type == PyArray_UBYTE) || \\\n\t\t\t\t (type == PyArray_USHORT) || \\\n\t\t\t\t (type == PyArray_UINT) ||\t\\\n\t\t\t\t (type == PyArray_ULONG) || \\\n\t\t\t\t (type == PyArray_ULONGLONG))\n\n#define PyTypeNum_ISSIGNED(type) ((type == PyArray_BYTE) ||\t\\\n\t\t\t       (type == PyArray_SHORT) ||\t\\\n\t\t\t       (type == PyArray_INT) ||\t\\\n\t\t\t       (type == PyArray_LONG) ||\t\\\n\t\t\t       (type == PyArray_LONGLONG))\n\n#define PyTypeNum_ISINTEGER(type) ((type >= PyArray_BYTE) &&\t\\\n\t\t\t\t(type <= PyArray_ULONGLONG))\n       \n#define PyTypeNum_ISFLOAT(type) ((type >= PyArray_FLOAT) &&  \\\n\t\t\t      (type <= PyArray_LONGDOUBLE))\n\n#define PyTypeNum_ISNUMBER(type) (type <= PyArray_CLONGDOUBLE)\n\n#define PyTypeNum_ISSTRING(type) ((type == PyArray_UCHAR) || \\\n\t\t\t       (type == PyArray_UNICODE))\n\n#define PyTypeNum_ISCOMPLEX(type) ((type >= PyArray_CFLOAT) && \\\n\t\t\t\t(type <= PyArray_CLONGDOUBLE))\n\t\n#define PyTypeNum_ISPYTHON(type) ((type == PyArray_LONG) || \\\n\t\t\t\t  (type == PyArray_DOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_CDOUBLE) ||\t\\\n\t\t\t\t  (type == PyArray_OBJECT ))\n\n#define PyTypeNum_ISFLEXIBLE(type) ((type==PyArray_STRING) || \\\n\t\t\t\t    (type==PyArray_UNICODE) ||\t\\\n\t\t\t\t    (type==PyArray_VOID))\n\n#define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \\\n\t\t\t\t   (type < PyArray_USERDEF+\\\n\t\t\t\t    PyArray_NUMUSERTYPES))\n\n#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) &&   \\\n\t\t\t\t     (type <= PyArray_VOID)) ||\t   \\\n\t\t\t\t    (type >= PyArray_USERDEF))\n\t\t\t\t    \n#define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT)\n\n#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))\n#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))\n#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))\n#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))\n#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))\n#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))\n#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))\n#define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj))\n#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))\n#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))\n#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))\n#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))\n\n/* Object arrays ignore notswapped flag */\n#define PyArray_ISNOTSWAPPED(m) (PyArray_CHKFLAGS(m, NOTSWAPPED) || \\\n\t\t\t\t PyArray_ISOBJECT(m))\n\n\n  /*  Often, rather than always convert to an array, \n      we may want to delegate behavior for other objects passed in\n  */\n\n\t/* \n\n#define Py_DELEGATE(op, name)                                     \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, NULL);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS(op, name, args)\t\t\t  \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_CallObject(meth, args);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\n#define Py_DELEGATE_ARGS_KWDS(op, name, args, kwds)\t          \\\n\tif (PyObject_HasAttrString(op, #name)) {                  \\\n\t\tPyObject *ret=NULL;\t\t\t\t  \\\n\t\tPyObject *meth=PyObject_GetAttrString(op, #name); \\\n\t\tif (PyCallable_Check(meth)) {\t\t\t  \\\n\t\t\tret = PyObject_Call(meth, args, kwds);\t  \\\n\t\t}\t\t\t\t\t\t  \\\n                Py_XDECREF(args);                                 \\\n\t\tPy_XDECREF(meth);\t\t\t\t  \\\n\t\treturn ret;\t\t\t\t\t  \\\n\t}\n\t*/\n\n\n        /* Includes the \"function\" C-API -- these are all stored in a \n\t   list of pointers --- one for each file\n\t   The two lists are concatenated into one in multiarray.\n\t   \n\t   They are available as import_array()\n         */\n\n#include \"__multiarray_api.h\"\n\n\n        /* C-API that requries previous API to be defined */\n\n#define PyArray_Check(op) (PyObject_TypeCheck((op), &PyBigArray_Type))\n#define PyBigArray_CheckExact(op) ((op)->ob_type == &PyBigArray_Type)\n#define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type)\n\n#define PyArray_CheckScalar(m) (PyObject_TypeCheck((m),\t\t\t\\\n\t\t\t\t\t\t   &PyGenericArrType_Type) \\\n\t\t\t\t|| ((PyArray_Check((m))) &&\t\t\\\n\t\t\t\t    (((PyArrayObject *)(m))->nd == 0)))\n#define PyArray_IsScalar(obj, cls)\t\t\t\t\\\n\t(PyObject_TypeCheck((obj), &Py##cls##ArrType_Type))\n#define PyArray_IsPythonScalar(obj) \\\n\t(PyInt_Check(obj) || PyFloat_Check(obj) || PyComplex_Check(obj) || \\\n\t PyLong_Check(obj) || PyBool_Check(obj) || PyString_Check(obj) || \\\n\t PyUnicode_Check(obj))\n#define PyArray_IsAnyScalar(obj) \\\n\t(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))\n\n#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? Py_INCREF(m), m : \\\n\t  (PyArrayObject *)(PyArray_ContiguousFromObject((PyObject *)(m), \\\n\t\t                      PyArray_TYPE(m), 0, 0))) \n\n#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))\n#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))\n#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0)\n#define PyArray_FROM_OF(m,flags) PyArray_FromAny(m, NULL, 0, 0, flags)\n\n#define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)\n#define MAX_ELSIZE 2*SIZEOF_LONGDOUBLE\n\n#define PyArray_SimpleNew(nd, dims, typenum) \\\n\tPyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)\n\n        /*Compatibility with old Numeric stuff -- don't use in new code */\n\n#define PyArray_UNSIGNED_TYPES\n#define PyArray_SBYTE PyArray_BYTE\n#define PyArray_CHAR PyArray_BYTE\n#define PyArray_CopyArray PyArray_CopyInto\n#define _PyArray_multiply_list PyArray_MultiplyIntList\n#define PyArray_ISSPACESAVER(m) FALSE\n#define PyScalarArray_Check PyArray_CheckScalar\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !Py_ARRAYOBJECT_H */\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": 252,
                "complexity": 0,
                "token_count": 1156,
                "diff_parsed": {
                    "added": [
                        "#    define LONGLONG_FMT         \"I64d\"",
                        "#    define ULONGLONG_FMT        \"I64u\"",
                        "\t/* #define LONGLONG_FMT   \"lld\"      Another possible variant",
                        "           #define ULONGLONG_FMT  \"llu\"",
                        "\t   #define LONGLONG_FMT   \"qd\"   -- BSD perhaps?",
                        "\t   #define ULONGLONG_FMT   \"qu\"",
                        "#    define LONGLONG_FMT         \"Ld\"",
                        "#    define ULONGLONG_FMT        \"Lu\"",
                        "#define INTP_FMT \"d\"",
                        "        #define INTP_FMT \"Ld\""
                    ],
                    "deleted": [
                        "#    define LONGLONG_FMT         \"%I64d\"",
                        "#    define ULONGLONG_FMT        \"%I64u\"",
                        "\t/* #define LONGLONG_FMT   \"%lld\"      Another possible variant",
                        "           #define ULONGLONG_FMT  \"%llu\"",
                        "\t   #define LONGLONG_FMT   \"%qd\"   -- BSD perhaps?",
                        "\t   #define ULONGLONG_FMT   \"%qu\"",
                        "#    define LONGLONG_FMT         \"%Ld\"",
                        "#    define ULONGLONG_FMT        \"%Lu\"",
                        "#define INTP_FMT \"%d\"",
                        "        #define INTP_FMT \"%Ld\""
                    ]
                }
            },
            {
                "old_path": "scipy/base/records.py",
                "new_path": "scipy/base/records.py",
                "filename": "records.py",
                "extension": "py",
                "change_type": "MODIFY",
                "diff": "@@ -1,4 +1,4 @@\n-import scipy.base as sb\n+import numeric as sb\n import sys\n import types\n import re\n",
                "added_lines": 1,
                "deleted_lines": 1,
                "source_code": "import numeric as sb\nimport sys\nimport types\nimport re\n\n# formats regular expression\n# allows multidimension spec with a tuple syntax in front \n# of the letter code '(2,3)f4' and ' (  2 ,  3  )  f4  ' \n# are equally allowed\nformat_re = re.compile(r'(?P<repeat> *[(]?[ ,0-9]*[)]? *)(?P<dtype>[A-Za-z0-9.]*)')\n\nnumfmt = sb.typeDict\n\ndef find_duplicate(list):\n    \"\"\"Find duplication in a list, return a list of dupicated elements\"\"\"\n    dup = []\n    for i in range(len(list)):\n        if (list[i] in list[i+1:]):\n            if (list[i] not in dup):\n                dup.append(list[i])\n    return dup\n\ndef _split(input):\n    \"\"\"Split the input formats string into field formats without splitting \n       the tuple used to specify multi-dimensional arrays.\"\"\"\n\n    newlist = []\n    hold = ''\n\n    for element in input.split(','):\n        if hold != '':\n            item = hold + ',' + element\n        else:\n            item = element\n        left = item.count('(')\n        right = item.count(')')\n\n        # if the parenthesis is not balanced, hold the string\n        if left > right :\n            hold = item  \n\n        # when balanced, append to the output list and reset the hold\n        elif left == right:\n            newlist.append(item)\n            hold = ''\n\n        # too many close parenthesis is unacceptable\n        else:\n            raise SyntaxError, item\n\n    # if there is string left over in hold\n    if hold != '':\n        raise SyntaxError, hold\n\n    return newlist\n\n\nclass format_parser:\n    def __init__(self, formats, aligned=0):\n        self._parseFormats(formats, aligned)\n\n    def _parseFormats(self, formats, aligned=0):\n        \"\"\" Parse the field formats \"\"\"\n\n        revdict = sb.revdict\n        if (type(formats) in [types.ListType, types.TupleType]):\n            _fmt = formats[:]\n        elif (type(formats) == types.StringType):\n            _fmt = _split(formats)\n        else:\n            raise NameError, \"illegal input formats %s\" % `formats`\n\n        self._nfields = len(_fmt)\n        self._repeats = [1] * self._nfields\n        self._itemsizes = [0] * self._nfields\n        self._sizes = [0] * self._nfields\n        self._stops = [0] * self._nfields\n        self._rec_aligned = aligned\n\n        # preserve the input for future reference\n        self._formats = [''] * self._nfields\n\n        sum = 0\n        maxalign = 1\n        unisize = sb.typeinfo['UNICODE'][2] or 2\n        print unisize\n        for i in range(self._nfields):\n\n            # parse the formats into repeats and formats\n            try:\n                (_repeat, _dtype) = format_re.match(_fmt[i].strip()).groups()\n            except TypeError, AttributeError: \n                raise ValueError('format %s is not recognized' % _fmt[i])\n\n            # Flexible types need special treatment\n            _dtype = _dtype.strip()\n            if _dtype[0] in ['V','S','U']:\n                self._itemsizes[i] = int(_dtype[1:])\n                if _dtype[0] == 'U':\n                    self._itemsizes[i] *= unisize\n                _dtype = _dtype[0]\n\n            if _repeat == '': \n                _repeat = 1\n            else: \n                _repeat = eval(_repeat)\n            _fmt[i] = numfmt[_dtype]\n            if not issubclass(_fmt[i], sb.Flexible):\n                self._itemsizes[i] = revdict[_fmt[i]][0][2] >> 3\n            self._repeats[i] = _repeat\n\n            if (type(_repeat) in [types.ListType, types.TupleType]):\n                self._sizes[i] = self._itemsizes[i] * reduce(lambda x,y: x*y, _repeat)\n            else:\n                self._sizes[i] = self._itemsizes[i] * _repeat\n\n            sum += self._sizes[i]\n            if self._rec_aligned:\n                # round sum up to multiple of alignment factor\n                align = revdict[_fmt[i]][0][3]\n                sum = ((sum + align - 1)/align) * align\n                maxalign = max(maxalign, align)\n            self._stops[i] = sum - 1\n\n            # Unify the appearance of _format, independent of input formats\n            revfmt = revdict[_fmt[i]][1][0]\n            self._formats[i] = `_repeat`+revfmt\n            if issubclass(_fmt[i], sb.Flexible):\n                if issubclass(_fmt[i], sb.Unicode):\n                    self._formats[i] += `self._itemsizes[i] / unisize`\n                else:\n                    self._formats[i] += `self._itemsizes[i]`\n            elif issubclass(_fmt[i], sb.Object):\n                pass\n            else:\n                self._formats[i] += `revdict[_fmt[i]][1][1]`\n\n        self._fmt = _fmt\n        # This pads record so next record is aligned if self._rec_align is true.\n        # Otherwise next the record starts right after the end of the last one.\n        self._total_itemsize = (self._stops[-1]/maxalign + 1) * maxalign\n        \n\n\nclass RecArray(sb.ndarray):\n    def __new__(self, *args, **kwds):\n        buf = args[0]\n        formats = args[1]\n        shape = kwds.get('shape',-1)\n        aligned = kwds.get('aligned',0)\n        parsed = format_parser(formats, aligned)\n        itemsize = parsed._total_itemsize\n        if (shape != None):\n            if type(shape) in [types.IntType, types.LongType]: \n                shape = (shape,)\n            elif (type(shape) == types.TupleType and type(shape[0]) in \\\n                  [types.IntType, types.LongType]):\n                pass\n            else: \n                raise NameError, \"Illegal shape %s\" % `shape`\n\n        typecode = 'V%d' % itemsize\n        if buf is None:\n            this = sb.ndarray.__new__(RecArray, shape, typecode)\n        else:\n            byteorder = kwds.get('byteorder', sys.byteorder)\n            swapped = 0\n            if (byteorder != sys.byteorder):\n                swapped = 1\n            this = sb.ndarray.__new__(RecArray, shape, typecode, buffer=buf,\n                                      swapped=swapped)\n        this.parsed = parsed\n        return this\n    \n\n    def __init__(self, buf, formats, shape=-1, names=None, byteoffset=0,\n                 bytestride=None, byteorder=sys.byteorder, aligned=0):\n        print \"init: \", buf, formats, shape, names, byteoffset, bytestride,\\\n              byteorder, aligned\n        self._updateattr()        \n        self._fieldNames(names)\n        self._fields = {}\n\n\n        # This should grab the names out of self.parsed that are important\n        #  to have later and should set self._attributes\n        #  to the list of meta information that needs to be carried around\n    def _updateattr(self):\n        self._nfields = self.parsed._nfields\n        self._attributes = ['_rec_aligned', '_nfields']\n        del self.parsed\n\n    def __array_finalize__(self, obj):\n        self._attributes = obj._attributes\n        for key in self._attributes:\n            setattr(self, key, getattr(obj, key))\n\n    def _fieldNames(self, names=None):\n        \"\"\"convert input field names into a list and assign to the _names\n        attribute \"\"\"\n\n        if (names):\n            if (type(names) in [types.ListType, types.TupleType]):\n                pass\n            elif (type(names) == types.StringType):\n                names = names.split(',')\n            else:\n                raise NameError, \"illegal input names %s\" % `names`\n\n            self._names = map(lambda n:n.strip(), names)[:self._nfields]\n        else: \n            self._names = []\n\n        # if the names are not specified, they will be assigned as \"c1, c2,...\"\n        # if not enough names are specified, they will be assigned as \"c[n+1],\n        # c[n+2],...\" etc. where n is the number of specified names...\"\n        self._names += map(lambda i: \n            'c'+`i`, range(len(self._names)+1,self._nfields+1))\n\n        # check for redundant names\n        _dup = find_duplicate(self._names)\n        if _dup:\n            raise ValueError, \"Duplicate field names: %s\" % _dup\n\n",
                "source_code_before": "import scipy.base as sb\nimport sys\nimport types\nimport re\n\n# formats regular expression\n# allows multidimension spec with a tuple syntax in front \n# of the letter code '(2,3)f4' and ' (  2 ,  3  )  f4  ' \n# are equally allowed\nformat_re = re.compile(r'(?P<repeat> *[(]?[ ,0-9]*[)]? *)(?P<dtype>[A-Za-z0-9.]*)')\n\nnumfmt = sb.typeDict\n\ndef find_duplicate(list):\n    \"\"\"Find duplication in a list, return a list of dupicated elements\"\"\"\n    dup = []\n    for i in range(len(list)):\n        if (list[i] in list[i+1:]):\n            if (list[i] not in dup):\n                dup.append(list[i])\n    return dup\n\ndef _split(input):\n    \"\"\"Split the input formats string into field formats without splitting \n       the tuple used to specify multi-dimensional arrays.\"\"\"\n\n    newlist = []\n    hold = ''\n\n    for element in input.split(','):\n        if hold != '':\n            item = hold + ',' + element\n        else:\n            item = element\n        left = item.count('(')\n        right = item.count(')')\n\n        # if the parenthesis is not balanced, hold the string\n        if left > right :\n            hold = item  \n\n        # when balanced, append to the output list and reset the hold\n        elif left == right:\n            newlist.append(item)\n            hold = ''\n\n        # too many close parenthesis is unacceptable\n        else:\n            raise SyntaxError, item\n\n    # if there is string left over in hold\n    if hold != '':\n        raise SyntaxError, hold\n\n    return newlist\n\n\nclass format_parser:\n    def __init__(self, formats, aligned=0):\n        self._parseFormats(formats, aligned)\n\n    def _parseFormats(self, formats, aligned=0):\n        \"\"\" Parse the field formats \"\"\"\n\n        revdict = sb.revdict\n        if (type(formats) in [types.ListType, types.TupleType]):\n            _fmt = formats[:]\n        elif (type(formats) == types.StringType):\n            _fmt = _split(formats)\n        else:\n            raise NameError, \"illegal input formats %s\" % `formats`\n\n        self._nfields = len(_fmt)\n        self._repeats = [1] * self._nfields\n        self._itemsizes = [0] * self._nfields\n        self._sizes = [0] * self._nfields\n        self._stops = [0] * self._nfields\n        self._rec_aligned = aligned\n\n        # preserve the input for future reference\n        self._formats = [''] * self._nfields\n\n        sum = 0\n        maxalign = 1\n        unisize = sb.typeinfo['UNICODE'][2] or 2\n        print unisize\n        for i in range(self._nfields):\n\n            # parse the formats into repeats and formats\n            try:\n                (_repeat, _dtype) = format_re.match(_fmt[i].strip()).groups()\n            except TypeError, AttributeError: \n                raise ValueError('format %s is not recognized' % _fmt[i])\n\n            # Flexible types need special treatment\n            _dtype = _dtype.strip()\n            if _dtype[0] in ['V','S','U']:\n                self._itemsizes[i] = int(_dtype[1:])\n                if _dtype[0] == 'U':\n                    self._itemsizes[i] *= unisize\n                _dtype = _dtype[0]\n\n            if _repeat == '': \n                _repeat = 1\n            else: \n                _repeat = eval(_repeat)\n            _fmt[i] = numfmt[_dtype]\n            if not issubclass(_fmt[i], sb.Flexible):\n                self._itemsizes[i] = revdict[_fmt[i]][0][2] >> 3\n            self._repeats[i] = _repeat\n\n            if (type(_repeat) in [types.ListType, types.TupleType]):\n                self._sizes[i] = self._itemsizes[i] * reduce(lambda x,y: x*y, _repeat)\n            else:\n                self._sizes[i] = self._itemsizes[i] * _repeat\n\n            sum += self._sizes[i]\n            if self._rec_aligned:\n                # round sum up to multiple of alignment factor\n                align = revdict[_fmt[i]][0][3]\n                sum = ((sum + align - 1)/align) * align\n                maxalign = max(maxalign, align)\n            self._stops[i] = sum - 1\n\n            # Unify the appearance of _format, independent of input formats\n            revfmt = revdict[_fmt[i]][1][0]\n            self._formats[i] = `_repeat`+revfmt\n            if issubclass(_fmt[i], sb.Flexible):\n                if issubclass(_fmt[i], sb.Unicode):\n                    self._formats[i] += `self._itemsizes[i] / unisize`\n                else:\n                    self._formats[i] += `self._itemsizes[i]`\n            elif issubclass(_fmt[i], sb.Object):\n                pass\n            else:\n                self._formats[i] += `revdict[_fmt[i]][1][1]`\n\n        self._fmt = _fmt\n        # This pads record so next record is aligned if self._rec_align is true.\n        # Otherwise next the record starts right after the end of the last one.\n        self._total_itemsize = (self._stops[-1]/maxalign + 1) * maxalign\n        \n\n\nclass RecArray(sb.ndarray):\n    def __new__(self, *args, **kwds):\n        buf = args[0]\n        formats = args[1]\n        shape = kwds.get('shape',-1)\n        aligned = kwds.get('aligned',0)\n        parsed = format_parser(formats, aligned)\n        itemsize = parsed._total_itemsize\n        if (shape != None):\n            if type(shape) in [types.IntType, types.LongType]: \n                shape = (shape,)\n            elif (type(shape) == types.TupleType and type(shape[0]) in \\\n                  [types.IntType, types.LongType]):\n                pass\n            else: \n                raise NameError, \"Illegal shape %s\" % `shape`\n\n        typecode = 'V%d' % itemsize\n        if buf is None:\n            this = sb.ndarray.__new__(RecArray, shape, typecode)\n        else:\n            byteorder = kwds.get('byteorder', sys.byteorder)\n            swapped = 0\n            if (byteorder != sys.byteorder):\n                swapped = 1\n            this = sb.ndarray.__new__(RecArray, shape, typecode, buffer=buf,\n                                      swapped=swapped)\n        this.parsed = parsed\n        return this\n    \n\n    def __init__(self, buf, formats, shape=-1, names=None, byteoffset=0,\n                 bytestride=None, byteorder=sys.byteorder, aligned=0):\n        print \"init: \", buf, formats, shape, names, byteoffset, bytestride,\\\n              byteorder, aligned\n        self._updateattr()        \n        self._fieldNames(names)\n        self._fields = {}\n\n\n        # This should grab the names out of self.parsed that are important\n        #  to have later and should set self._attributes\n        #  to the list of meta information that needs to be carried around\n    def _updateattr(self):\n        self._nfields = self.parsed._nfields\n        self._attributes = ['_rec_aligned', '_nfields']\n        del self.parsed\n\n    def __array_finalize__(self, obj):\n        self._attributes = obj._attributes\n        for key in self._attributes:\n            setattr(self, key, getattr(obj, key))\n\n    def _fieldNames(self, names=None):\n        \"\"\"convert input field names into a list and assign to the _names\n        attribute \"\"\"\n\n        if (names):\n            if (type(names) in [types.ListType, types.TupleType]):\n                pass\n            elif (type(names) == types.StringType):\n                names = names.split(',')\n            else:\n                raise NameError, \"illegal input names %s\" % `names`\n\n            self._names = map(lambda n:n.strip(), names)[:self._nfields]\n        else: \n            self._names = []\n\n        # if the names are not specified, they will be assigned as \"c1, c2,...\"\n        # if not enough names are specified, they will be assigned as \"c[n+1],\n        # c[n+2],...\" etc. where n is the number of specified names...\"\n        self._names += map(lambda i: \n            'c'+`i`, range(len(self._names)+1,self._nfields+1))\n\n        # check for redundant names\n        _dup = find_duplicate(self._names)\n        if _dup:\n            raise ValueError, \"Duplicate field names: %s\" % _dup\n\n",
                "methods": [
                    {
                        "name": "find_duplicate",
                        "long_name": "find_duplicate( list )",
                        "filename": "records.py",
                        "nloc": 7,
                        "complexity": 4,
                        "token_count": 59,
                        "parameters": [
                            "list"
                        ],
                        "start_line": 14,
                        "end_line": 21,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_split",
                        "long_name": "_split( input )",
                        "filename": "records.py",
                        "nloc": 20,
                        "complexity": 6,
                        "token_count": 95,
                        "parameters": [
                            "input"
                        ],
                        "start_line": 23,
                        "end_line": 55,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , formats , aligned = 0 )",
                        "filename": "records.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 19,
                        "parameters": [
                            "self",
                            "formats",
                            "aligned"
                        ],
                        "start_line": 59,
                        "end_line": 60,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_parseFormats",
                        "long_name": "_parseFormats( self , formats , aligned = 0 )",
                        "filename": "records.py",
                        "nloc": 61,
                        "complexity": 15,
                        "token_count": 609,
                        "parameters": [
                            "self",
                            "formats",
                            "aligned"
                        ],
                        "start_line": 62,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__new__",
                        "long_name": "__new__( self , * args , ** kwds )",
                        "filename": "records.py",
                        "nloc": 27,
                        "complexity": 7,
                        "token_count": 210,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 146,
                        "end_line": 173,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , buf , formats , shape = - 1 , names = None , byteoffset = 0 , bytestride = None , byteorder = sys . byteorder , aligned = 0 )",
                        "filename": "records.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "self",
                            "buf",
                            "formats",
                            "shape",
                            "names",
                            "byteoffset",
                            "bytestride",
                            "byteorder",
                            "aligned"
                        ],
                        "start_line": 176,
                        "end_line": 182,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_updateattr",
                        "long_name": "_updateattr( self )",
                        "filename": "records.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 27,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 188,
                        "end_line": 191,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__array_finalize__",
                        "long_name": "__array_finalize__( self , obj )",
                        "filename": "records.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 34,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 193,
                        "end_line": 196,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_fieldNames",
                        "long_name": "_fieldNames( self , names = None )",
                        "filename": "records.py",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "self",
                            "names"
                        ],
                        "start_line": 198,
                        "end_line": 223,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 1
                    }
                ],
                "methods_before": [
                    {
                        "name": "find_duplicate",
                        "long_name": "find_duplicate( list )",
                        "filename": "records.py",
                        "nloc": 7,
                        "complexity": 4,
                        "token_count": 59,
                        "parameters": [
                            "list"
                        ],
                        "start_line": 14,
                        "end_line": 21,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "_split",
                        "long_name": "_split( input )",
                        "filename": "records.py",
                        "nloc": 20,
                        "complexity": 6,
                        "token_count": 95,
                        "parameters": [
                            "input"
                        ],
                        "start_line": 23,
                        "end_line": 55,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 33,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , formats , aligned = 0 )",
                        "filename": "records.py",
                        "nloc": 2,
                        "complexity": 1,
                        "token_count": 19,
                        "parameters": [
                            "self",
                            "formats",
                            "aligned"
                        ],
                        "start_line": 59,
                        "end_line": 60,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 2,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_parseFormats",
                        "long_name": "_parseFormats( self , formats , aligned = 0 )",
                        "filename": "records.py",
                        "nloc": 61,
                        "complexity": 15,
                        "token_count": 609,
                        "parameters": [
                            "self",
                            "formats",
                            "aligned"
                        ],
                        "start_line": 62,
                        "end_line": 141,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 80,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__new__",
                        "long_name": "__new__( self , * args , ** kwds )",
                        "filename": "records.py",
                        "nloc": 27,
                        "complexity": 7,
                        "token_count": 210,
                        "parameters": [
                            "self",
                            "args",
                            "kwds"
                        ],
                        "start_line": 146,
                        "end_line": 173,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 28,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__init__",
                        "long_name": "__init__( self , buf , formats , shape = - 1 , names = None , byteoffset = 0 , bytestride = None , byteorder = sys . byteorder , aligned = 0 )",
                        "filename": "records.py",
                        "nloc": 7,
                        "complexity": 1,
                        "token_count": 72,
                        "parameters": [
                            "self",
                            "buf",
                            "formats",
                            "shape",
                            "names",
                            "byteoffset",
                            "bytestride",
                            "byteorder",
                            "aligned"
                        ],
                        "start_line": 176,
                        "end_line": 182,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 7,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_updateattr",
                        "long_name": "_updateattr( self )",
                        "filename": "records.py",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 27,
                        "parameters": [
                            "self"
                        ],
                        "start_line": 188,
                        "end_line": 191,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "__array_finalize__",
                        "long_name": "__array_finalize__( self , obj )",
                        "filename": "records.py",
                        "nloc": 4,
                        "complexity": 2,
                        "token_count": 34,
                        "parameters": [
                            "self",
                            "obj"
                        ],
                        "start_line": 193,
                        "end_line": 196,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 1
                    },
                    {
                        "name": "_fieldNames",
                        "long_name": "_fieldNames( self , names = None )",
                        "filename": "records.py",
                        "nloc": 16,
                        "complexity": 5,
                        "token_count": 145,
                        "parameters": [
                            "self",
                            "names"
                        ],
                        "start_line": 198,
                        "end_line": 223,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 26,
                        "top_nesting_level": 1
                    }
                ],
                "changed_methods": [],
                "nloc": 156,
                "complexity": 42,
                "token_count": 1314,
                "diff_parsed": {
                    "added": [
                        "import numeric as sb"
                    ],
                    "deleted": [
                        "import scipy.base as sb"
                    ]
                }
            },
            {
                "old_path": "scipy/base/src/arraytypes.inc.src",
                "new_path": "scipy/base/src/arraytypes.inc.src",
                "filename": "arraytypes.inc.src",
                "extension": "src",
                "change_type": "MODIFY",
                "diff": "@@ -569,13 +569,13 @@ static void\n \n #fname=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n #type=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#\n-#format=\"%hd\",\"%hu\",\"%d\",\"%u\",\"%ld\",\"%lu\",LONGLONG_FMT,ULONGLONG_FMT,\"%f\",\"%lf\",\"%Lf\"#\n+#format=\"hd\",\"hu\",\"d\",\"u\",\"ld\",\"lu\",LONGLONG_FMT,ULONGLONG_FMT,\"f\",\"lf\",\"Lf\"#\n */\n static int\n @fname@_scan (FILE *fp, @type@ *ip, int itemsize, char *sep, PyArrayObject *ao)\n {\n \tint num;\n-\tnum = fscanf(fp, @format@, ip);\n+\tnum = fscanf(fp, \"%\"@format@, ip);\n \tif (num != 1) {\n \t\tif (num == 0) return -3;\n \t\tif (num == EOF) return -4;\n",
                "added_lines": 2,
                "deleted_lines": 2,
                "source_code": "/* -*- c -*- */\n\nstatic ulong\nMyPyLong_AsUnsignedLong(PyObject *vv)\n{\n\tif ((vv != NULL) && PyInt_Check(vv)) {\n\t\tlong val = PyInt_AsLong(vv);\n\t\tif (val < 0) {\n\t\t\tPyErr_SetString(PyExc_OverflowError,\n\t\t\t\"can't convert negative value to unsigned long\");\n\t\t\treturn (ulong) -1;\n\t\t}\n\t\treturn val;\n\t}\n\treturn PyLong_AsUnsignedLong(vv);\t\n}\n\nstatic ulonglong\nMyPyLong_AsUnsignedLongLong(PyObject *vv)\n{\n\tif ((vv != NULL) && PyInt_Check(vv)) {\n\t\tlonglong val = PyInt_AsLong(vv);\n\t\tif (val < 0) {\n\t\t\tPyErr_SetString(PyExc_OverflowError,\n\t\t\t\"can't convert negative value to unsigned long\");\n\t\t\treturn (ulonglong) -1;\n\t\t}\n\t\treturn val;\n\t}\n\treturn PyLong_AsUnsignedLongLong(vv);\t\n}\n\n/****************** getitem and setitem **********************/\n\n/**begin repeat\n\n#TYP=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,LONG,UINT,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE#\n#func1=PyBool_FromLong, PyInt_FromLong*6, PyLong_FromUnsignedLong*2, PyLong_FromLongLong, PyLong_FromUnsignedLongLong, PyFloat_FromDouble*2#\n#func2=PyObject_IsTrue, PyInt_AsLong*6, MyPyLong_AsUnsignedLong*2, PyLong_AsLongLong, MyPyLong_AsUnsignedLongLong, PyFloat_AsDouble*2#\n#typ=Bool, byte, ubyte, short, ushort, int, long, uint, ulong, longlong, ulonglong, float, double#\n#typ1=long*7, ulong*2, longlong, ulonglong, float, double#\n#kind=Bool, Byte, UByte, Short, UShort, Int, Long, UInt, ULong, LongLong, ULongLong, Float, Double#\n*/\n\nstatic PyObject * \n@TYP@_getitem(char *ip, PyArrayObject *ap) {\n        @typ@ t1;\n\n\tif ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {\n                t1 = *((@typ@ *)ip);\n                return @func1@((@typ1@)t1);\n\t}\n\telse {\n                ap->descr->copyswap(&t1, ip, !PyArray_ISNOTSWAPPED(ap),\n\t\t\t\t    ap->itemsize);\n                return @func1@((@typ1@)t1);\n\t}\n}\nstatic int \n@TYP@_setitem(PyObject *op, char *ov, PyArrayObject *ap) {\n        @typ@ temp;  /* ensures alignment */\n\n        if (PyArray_IsScalar(op, @kind@)) {\n                temp = ((Py@kind@ScalarObject *)op)->obval;\n        }\n        else {\n                temp = (@typ@)@func2@(op);\n        }\n        if (PyErr_Occurred()) return -1;\n        if (ap == NULL || PyArray_ISBEHAVED(ap)) \n                *((@typ@ *)ov)=temp;\n        else {\n                ap->descr->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), \n\t\t\t\t    ap->itemsize);\n        }\n        \n        return 0;\n}\n\n/**end repeat**/\n\n\n/**begin repeat \n\n#TYP=CFLOAT,CDOUBLE#\n#typ=float, double#\n*/\n\nstatic PyObject * \n@TYP@_getitem(char *ip, PyArrayObject *ap) {\n        @typ@ t1, t2;\n\n        if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {                \n                return PyComplex_FromDoubles((double)((@typ@ *)ip)[0], \n                                             (double)((@typ@ *)ip)[1]);\n        }\n        else {\n\t\tint size = sizeof(@typ@);\n\t\tBool swap = !PyArray_ISNOTSWAPPED(ap);\n                copy_and_swap(&t1, ip, size, 1, 0, swap);\n                copy_and_swap(&t2, ip+size, size, 1, 0, swap);\n                return PyComplex_FromDoubles((double)t1, (double)t2);\n        }\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYP=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#typ=float, double, longdouble#\n#kind=CFloat, CDouble, CLongDouble#\n*/\nstatic int \n@TYP@_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n        Py_complex oop;\n        PyObject *op2;\n        c@typ@ temp;\n\tint rsize;\n        \n        if (!(PyArray_IsScalar(op, @kind@))) {\n                if (PyArray_CheckScalar(op))                         \n                        op2 = ((PyArrayObject *)op)->descr->getitem     \\\n                                (((PyArrayObject *)op)->data, \n                                 (PyArrayObject *)op);\n                else { \n                        op2 = op; Py_INCREF(op);\n                }\n                oop = PyComplex_AsCComplex (op2);\n                Py_DECREF(op2);\n                if (PyErr_Occurred()) return -1;\n                temp.real = (@typ@) oop.real;\n                temp.imag = (@typ@) oop.imag;  \n        }\n\telse {\n                temp = ((Py@kind@ScalarObject *)op)->obval;\n        }\n\t\n        memcpy(ov, &temp, ap->itemsize);\n        if (!PyArray_ISNOTSWAPPED(ap))\n                byte_swap_vector(ov, 2, sizeof(@typ@));\n\t\n\trsize = sizeof(@typ@);\n\tcopy_and_swap(ov, &temp, rsize, 2, rsize, !PyArray_ISNOTSWAPPED(ap));\n        return 0;\n}\n/**end repeat**/\n\nstatic PyObject * \nLONGDOUBLE_getitem(char *ip, PyArrayObject *ap) \n{\n        return PyArray_Scalar(ip, PyArray_LONGDOUBLE, sizeof(longdouble), \n                              !PyArray_ISNOTSWAPPED(ap));\n}\n\nstatic int \nLONGDOUBLE_setitem(PyObject *op, char *ov, PyArrayObject *ap) {\n        longdouble temp;  /* ensures alignment */\n\n        if (PyArray_IsScalar(op, LongDouble)) {\n                temp = ((PyLongDoubleScalarObject *)op)->obval;\n        }\n        else {\n                temp = (longdouble)PyFloat_AsDouble(op);\n        }\n        if (PyErr_Occurred()) return -1;\n        if (ap == NULL || PyArray_ISBEHAVED(ap)) \n                *((longdouble *)ov)=temp;\n        else {\n                copy_and_swap(ov, &temp, ap->itemsize, 1, 0,\n                              !PyArray_ISNOTSWAPPED(ap));\n        }\n        \n        return 0;\n}\n\nstatic PyObject * \nCLONGDOUBLE_getitem(char *ip, PyArrayObject *ap) \n{\n        return PyArray_Scalar(ip, PyArray_CLONGDOUBLE, sizeof(clongdouble), \n                              !PyArray_ISNOTSWAPPED(ap));\n}\n\n\n\n/* UNICODE */\nstatic PyObject * \nUNICODE_getitem(char *ip, PyArrayObject *ap) \n{\n\tPyObject *obj;\n\tsize_t size = sizeof(Py_UNICODE);\n\t\n\tobj = PyUnicode_FromUnicode((const Py_UNICODE *)ip, \n\t\t\t\t    ap->itemsize / size);\n\tif (!PyArray_ISNOTSWAPPED(ap) && (obj != NULL)) {\n\t\tbyte_swap_vector(PyUnicode_AS_UNICODE(obj),\n\t\t\t\t ap->itemsize / size, size);\n\t}\n\treturn obj;\n}\n\nstatic int \nUNICODE_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n        PyObject *temp;\n\tPy_UNICODE *ptr;\n\tint datalen;\n\tsize_t size = sizeof(Py_UNICODE);\n\n\tif ((temp=PyObject_Unicode(op)) == NULL) return -1;\n\n\tptr = PyUnicode_AS_UNICODE(temp);\n\tif ((ptr == NULL) || (PyErr_Occurred())) {\n\t\tPy_DECREF(temp);\n\t\treturn -1;\n\t}\n\tdatalen = PyUnicode_GET_DATA_SIZE(op);\n\n\tmemcpy(ov, ptr, MIN(ap->itemsize, datalen));\n\t/* Fill in the rest of the space with 0 */\n\tif (ap->itemsize > datalen) {\n\t\tmemset(ov + datalen, 0, (ap->itemsize - datalen));\n\t}\n\n\tif (!PyArray_ISNOTSWAPPED(ap)) \n\t\tbyte_swap_vector(ov, ap->itemsize / size, size);\n\t\n\tPy_DECREF(temp);\n\treturn 0;\n}\n\n/* STRING */\nstatic \nPyObject * \nSTRING_getitem(char *ip, PyArrayObject *ap) \n{\n\treturn PyString_FromStringAndSize(ip,ap->itemsize);\n}\n\nstatic int \nSTRING_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n\tchar *ptr;\n\tint len;\n\tPyObject *temp=PyObject_Str(op);\n\t\n\tif (temp == NULL) return -1;\n\t\n\tif (PyString_AsStringAndSize(temp, &ptr, &len) == -1) {\n\t\tPy_DECREF(temp);\n\t\treturn -1;\n\t}\n\tmemcpy(ov, ptr, MIN(ap->itemsize,len));\n\tif (ap->itemsize > len) {\n\t\tmemset(ov + len, 0, (ap->itemsize - len));\n\t}\n\tPy_DECREF(temp);\n\treturn 0;\n}\n\n/* OBJECT */\n\nstatic PyObject * \nOBJECT_getitem(char *ip, PyArrayObject *ap) \n{\n\tPy_INCREF(*(PyObject **)ip);\n\treturn *(PyObject **)ip;\n}\n\nstatic int \nOBJECT_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n\tPy_XDECREF(*(PyObject **)ov);\n\tPy_INCREF(op);\n\t*(PyObject **)ov = op;\n\treturn PyErr_Occurred() ? -1:0;\n}\n\n/* VOID */\n\nstatic PyObject *\nVOID_getitem(char *ip, PyArrayObject *ap)\n{\n        PyObject *u=NULL;\n        PyObject *pyres=NULL;\n\tPyObject *args=NULL;\n        int itemsize=ap->itemsize;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj,\n\t\t\t\t\t      \"_getitem\");\n\n\n\tif (PyArray_ISWRITEABLE(ap))\n\t\tu = PyBuffer_FromReadWriteMemory(ip, itemsize);\n\telse\n\t\tu = PyBuffer_FromMemory(ip, itemsize);\n\tif (u==NULL) goto fail;\n\n\t/* default is to return buffer object pointing to current item */\n\t/*  a view of it */\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n\t\tPy_XDECREF(meth);\n\t\tPyErr_Clear();\n\t\treturn u;        \n\t}\n\n\targs = Py_BuildValue(\"OO\",u, ap);\n\tPy_DECREF(u);\n\tif (args==0) goto fail;\n        pyres = PyObject_CallObject(meth, args);\n\tPy_DECREF(args);\n\tPy_DECREF(meth);\n\treturn pyres;\n\n fail:\n        Py_XDECREF(meth);\n        Py_XDECREF(args);\n        Py_XDECREF(u);\n        return NULL;\n}\n\nstatic int\nVOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)\n{\n        PyObject *u=NULL;\n        PyObject *pyres=NULL;\n        PyObject *args=NULL;\n        int itemsize=ap->itemsize;\n\tint res;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj,\n\t\t\t\t\t      \"_setitem\");\n\n\t/* Default is to use buffer interface to set item */\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n\t\tconst void *buffer;\n\t\tint buflen;\n\t\tPyErr_Clear();\n\t\tres = PyObject_AsReadBuffer(op, &buffer, &buflen);\n\t\tif (res == -1) goto fail;\n\t\tmemcpy(ip, buffer, MIN(buflen, itemsize));\n\t\tPy_XDECREF(meth);\n\t\treturn 0;\n        }\n        u = PyBuffer_FromReadWriteMemory(ip, itemsize);\n\tif (u==NULL) goto fail;\n\targs = Py_BuildValue(\"OOO\",u, op, ap);\n        pyres = PyObject_CallObject(meth, args);\n        if (pyres==NULL) goto fail;\n\tres = 0;\n        if (PyErr_Occurred()) goto fail;        \n\n        Py_DECREF(meth);\n        Py_DECREF(args);\n        Py_DECREF(pyres);\n        Py_DECREF(u);\n        return res;\n\n fail:\n        Py_XDECREF(pyres);\n        Py_XDECREF(meth);\n        Py_XDECREF(args);\n        Py_XDECREF(u);\n        return -1;          \n}\n\n\n/****************** XXX_to_YYY *******************************/        \n\n/* Assumes contiguous, and aligned, from and to */\n\n\n/**begin repeat\n#to=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*16#\n#from=BYTE*13,UBYTE*13,SHORT*13,USHORT*13,INT*13,UINT*13,LONG*13,ULONG*13,LONGLONG*13,ULONGLONG*13,FLOAT*13,DOUBLE*13,LONGDOUBLE*13,CFLOAT*13,CDOUBLE*13,CLONGDOUBLE*13#\n#totyp=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*16#\n#fromtyp=byte*13, ubyte*13, short*13, ushort*13, int*13, uint*13, long*13, ulong*13, longlong*13, ulonglong*13, float*13, double*13, longdouble*13, float*13, double*13, longdouble*13#\n#incr= ip++*166,ip+=2*42#\n*/\nstatic void \n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++) {\n\t\t*op = (@totyp@)*ip;\n\t\t@incr@;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n#from=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#fromtyp=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@from@_to_BOOL(@fromtyp@ *ip, Bool *op, intp n, PyArrayObject *aip, \n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++,ip++) {\n\t\t*op = (Bool)(*ip != FALSE);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n#from=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#fromtyp=cfloat, cdouble, clongdouble#\n*/\nstatic void \n@from@_to_BOOL(@fromtyp@ *ip, Bool *op, intp n, PyArrayObject *aip, \n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++,ip++) {\n\t\t*op = (Bool)(((*ip).real != FALSE) && ((*ip).imag != FALSE));\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n#to=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#totyp=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \nBOOL_to_@to@(Bool *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t     PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++,ip++) {\n\t\t*op = (@totyp@)(*ip != FALSE);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#to=(CFLOAT,CDOUBLE,CLONGDOUBLE)*14#\n#from=BOOL*3,BYTE*3,UBYTE*3,SHORT*3,USHORT*3,INT*3,UINT*3,LONG*3,ULONG*3,LONGLONG*3,ULONGLONG*3,FLOAT*3,DOUBLE*3,LONGDOUBLE*3#\n#fromtyp=Bool*3,byte*3, ubyte*3, short*3, ushort*3, int*3, uint*3, long*3, ulong*3, longlong*3, ulonglong*3, float*3, double*3, longdouble*3#\n#totyp= (float, double, longdouble)*14#\n*/\nstatic void \n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip,\n\t       PyArrayObject *aop) {\n\tregister intp i;\n\tfor(i=0;i<n;i++,ip++) {\n\t\t*op++ = (@totyp@)*ip;\n\t\t*op++ = 0.0;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#to=(CFLOAT,CDOUBLE,CLONGDOUBLE)*3#\n#from=CFLOAT*3,CDOUBLE*3,CLONGDOUBLE*3#\n#totyp=(float, double, longdouble)*3#\n#fromtyp=float*3, double*3, longdouble*3#\n*/\nstatic void \n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip,\n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<2*n;i++,ip++,op++) {\n\t\t*op = (@totyp@)*ip;\n\t}\n}\n\n/**end repeat**/\n\n/**begin repeat \n\n#from=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID, OBJECT#\n#fromtyp=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char, PyObject *#\n#skip= 1*17, aip->itemsize*3, 1#\n*/\nstatic void \n@from@_to_OBJECT(@fromtyp@ *ip, PyObject **op, intp n, PyArrayObject *aip,\n\t\t PyArrayObject *aop)\n{\n\tregister intp i; \n\tint skip=@skip@;\n\tfor(i=0;i<n;i++,ip+=skip,op++) {\n\t\tPy_XDECREF(*op);\n\t\t*op = @from@_getitem((char *)ip, aip);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#to=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID#\n#totyp=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char#\n#skip= 1*17, aip->itemsize*3#\n*/\nstatic void \nOBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *aip,\n\t\t PyArrayObject *aop)\n{\n\tregister intp i; \n\tint skip=@skip@;\n\tfor(i=0;i<n;i++,ip++,op+=skip) {\n\t\t@to@_setitem(*ip, (char *)op, aop);\n\t}\n}\n/**end repeat**/\n\n\n\n/**begin repeat\n\n#from=STRING*20, UNICODE*20, VOID*20#\n#fromtyp=char*60#\n#to=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,STRING,UNICODE,VOID)*3#\n#totyp=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, void)*3#\n#oskip=(1*17,aop->itemsize*3)*3#\n*/\n\nstatic void\n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t     PyArrayObject *aop)\n{\n\tregister intp i;\n\tPyObject *temp=NULL;\n\tint skip=aip->itemsize;\n\tint oskip=@oskip@;\n\tfor(i=0; i<n; i++, ip+=skip, op+=oskip) {\n\t\ttemp = @from@_getitem((char *)ip, aip);\n\t\tif (temp==NULL) {\n\t\t\tPy_INCREF(Py_False);\n\t\t\ttemp = Py_False;\n\t\t}\n\t\t@to@_setitem(temp,(char *)op, aop);\n\t\tPy_DECREF(temp);\n\t}\n}\n\n/**end repeat**/\n\n/**begin repeat\n\n#to=STRING*17, UNICODE*17, VOID*17#\n#totyp=char*17, char*17, char*17#\n#from=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*3#\n#fromtyp=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble)*3#\n*/\n\nstatic void\n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t     PyArrayObject *aop)\n{\n\tregister intp i;\n\tPyObject *temp=NULL;\n\tint skip=1;\n\tint oskip=aop->itemsize;\n\tfor(i=0; i<n; i++, ip+=skip, op+=oskip) {\n\t\ttemp = @from@_getitem((char *)ip, aip);\n\t\tif (temp==NULL) {\n\t\t\tPy_INCREF(Py_False);\n\t\t\ttemp = Py_False;\n\t\t}\n\t\t@to@_setitem(temp,(char *)op, aop);\n\t\tPy_DECREF(temp);\n\t}\n}\n\n/**end repeat**/\n\n\n/****************** scan *************************************/\n\n/**begin repeat\n\n#fname=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#type=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#\n#format=\"hd\",\"hu\",\"d\",\"u\",\"ld\",\"lu\",LONGLONG_FMT,ULONGLONG_FMT,\"f\",\"lf\",\"Lf\"#\n*/\nstatic int\n@fname@_scan (FILE *fp, @type@ *ip, int itemsize, char *sep, PyArrayObject *ao)\n{\n\tint num;\n\tnum = fscanf(fp, \"%\"@format@, ip);\n\tif (num != 1) {\n\t\tif (num == 0) return -3;\n\t\tif (num == EOF) return -4;\n\t\treturn -5;\n\t}\n\tif (sep != NULL) {\n\t\tnum = fscanf(fp, sep);\n\t\tif (num == 0) return 0;\n\t\tif (num == EOF) return -1;\n\t}\n\treturn 0;\n}\n\n/**end repeat**/\n\n/**begin repeat\n#fname=BOOL,BYTE,UBYTE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID#\n*/\n#define @fname@_scan NULL\n/**end repeat**/\n\n\n\n/****************** copyswapn *************************************/\n\n/**begin repeat\n\n#fname=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#fsize=SHORT,SHORT,INT,INT,LONG,LONG,LONGLONG,LONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#type=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#\n*/\nstatic void\n@fname@_copyswapn (void *dst, void *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, n*sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\tfor (a = (char *)dst; n>0; n--) {\n#if SIZEOF_@fsize@ == 2\n\t\t\tb = a + 1;\n\t\t\tc = *a; *a++ = *b; *b = c;\n\t\t\ta += 1;\n#elif SIZEOF_@fsize@ == 4\n\t\t\tb = a + 3;\n                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 2;\n#elif SIZEOF_@fsize@ == 8\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\t\t\ta += 4;\n#elif SIZEOF_@fsize@ == 10\n                        b = a + 9;\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                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 5;\n#elif SIZEOF_@fsize@ == 12\n                        b = a + 11;\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                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 6;\n#elif SIZEOF_@fsize@ == 16\n                        b = a + 15;\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                        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\t\t\ta += 8;\n#else\n\t\t\tregister int i, nn;\n                        b = a + (SIZEOF_@fsize@-1);\n\t\t\tnn = SIZEOF_@fsize@ / 2;\n                        for (i=0; i<nn; i++) {\n                                c=*a; *a++ = *b; *b-- = c;\n                        }\n\t\t\ta += nn / 2;\n#endif\t\t\t\n\t\t}\n\t}\n}\n\nstatic void\n@fname@_copyswap (void *dst, void *src, int swap, int itemsize)\n{\n\n\tif (src != NULL) /* copy first if needed */\n                memcpy(dst, src, sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n                a = (char *)dst;\n#if SIZEOF_@fsize@ == 2\n                b = a + 1;\n                c = *a; *a++ = *b; *b = c;\n#elif SIZEOF_@fsize@ == 4\n                b = a + 3;\n                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 8\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#elif SIZEOF_@fsize@ == 10\n                b = a + 9;\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                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 12\n                b = a + 11;\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                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 16\n                b = a + 15;\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                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#else\n\t\t{\n\t\t\tregister int i, nn;\n                \tb = a + (SIZEOF_@fsize@-1);\n                \tnn = SIZEOF_@fsize@ / 2;\n                \tfor (i=0; i<nn; i++) {\n                        \tc=*a; *a++ = *b; *b-- = c;\n                \t}\n\t\t}\n#endif\t\t\t\n        }\n}\n\n\n/**end repeat**/\n\n/**begin repeat\n\n#fname=BOOL, BYTE, UBYTE#\n#type=Bool, byte, ubyte#\n*/\nstatic void\n@fname@_copyswapn (void *dst, void *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, n*sizeof(@type@));\n\t/* ignore swap */\n}\n\nstatic void\n@fname@_copyswap (void *dst, void *src, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, sizeof(@type@));\n\t/* ignore swap */\n}\n\n/**end repeat**/\n\n\n\n/**begin repeat\n\n#fname=CFLOAT,CDOUBLE,CLONGDOUBLE#\n#type=cfloat, cdouble, clongdouble#\n#fsize=FLOAT,DOUBLE,LONGDOUBLE#\n*/\nstatic void\n@fname@_copyswapn (void *dst, void *src, intp n, int swap, int itemsize)\n{\n\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, n*sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\t/* complex type -- swap twice as many */\n\t\tregister intp nn = 2*n;  \n\t\tfor (a = (char *)dst; nn>0; nn--) {\n#if SIZEOF_@fsize@ == 4\n\t\t\tb = a + 3;\n                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 2;\n#elif SIZEOF_@fsize@ == 8\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\t\t\ta += 4;\n#elif SIZEOF_@fsize@ == 10\n                        b = a + 9;\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                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 5;\n#elif SIZEOF_@fsize@ == 12\n                        b = a + 11;\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                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 6;\n#elif SIZEOF_@fsize@ == 16\n                        b = a + 15;\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                        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\t\t\ta += 8;\n#else\n\t\t\tregister int i, kn;\n\n                        b = a + (SIZEOF_@fsize@-1);\n\t\t\tkn = SIZEOF_@fsize@ / 2;\n                        for (i=0; i<kn; i++) {\n                                c=*a; *a++ = *b; *b-- = c;\n                        }\n\t\t\ta += kn / 2;\n#endif\t\t\t\n\t\t}\n\t}\n}\n\nstatic void\n@fname@_copyswap (void *dst, void *src, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\ta = (char *)dst;\n#if SIZEOF_@fsize@ == 4\n                b = a + 3;\n                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n                a += 2;\n                b = a + 3;\n                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 8\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                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#elif SIZEOF_@fsize@ == 10\n                b = a + 9;\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                c = *a; *a++ = *b; *b   = c;\n                a += 5;\n                b = a + 9;\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                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 12\n                b = a + 11;\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                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n                a += 6;\n                b = a + 11;\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                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 16\n                b = a + 15;\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                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                a += 8;\n                b = a + 15;\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                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#else\n\t\t{\n\t\t\tregister int i, nn;\n                \tb = a + (SIZEOF_@fsize@-1);\n                \tnn = SIZEOF_@fsize@ / 2;\n                \tfor (i=0; i<nn; i++) {\n                        \tc=*a; *a++ = *b; *b-- = c;\n                \t}\n                \ta += nn / 2;\n                \tb = a + (SIZEOF_@fsize@-1);\n                \tnn = SIZEOF_@fsize@ / 2;\n                \tfor (i=0; i<nn; i++) {\n                        \tc=*a; *a++ = *b; *b-- = c;\n                \t}\n\t\t}\n#endif\t\t\t\n        }\n}\n\n\n/**end repeat**/\n\nstatic void\nOBJECT_copyswapn (PyObject **dst, PyObject **src, intp n, int swap, int itemsize)\n{\n\tregister int i, nn=n;\n\tPyObject **dp=dst, **sp=src;\n\tPyObject *meth=NULL;\n\tPyObject *ret=NULL;\n\tif (src != NULL) {\n\t\tfor (i=0; i<nn; i++) {\n\t\t\tPy_XDECREF(*dp);\n\t\t\tPy_INCREF(*sp);\n\t\t\t*dp++ = *sp++;\n\t\t}\n\t}\n\tif (swap) {\n\t\t/* get .byteswap methods if they exist */\n\t\tdp = dst;\n\t\tfor (i=0; i<nn; i++) {\n\t\t\tmeth = PyObject_GetAttrString(*dp, \"byteswap\");\n\t\t\tif ((meth != NULL) && PyCallable_Check(meth)) {\n\t\t\t\tret = PyObject_CallObject(meth, NULL);\n\t\t\t\tPy_XDECREF(ret);\n\t\t\t}\n\t\t\tPy_XDECREF(meth);\n\t\t\tdp++;\n\t\t}\n\t}\n\treturn;\n}\n\n/* ignore swap */\nstatic void\nSTRING_copyswapn (char *dst, char *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize * n);\n\t\n\treturn;\n}\n\n/* ignore swap */\nstatic void\nVOID_copyswapn (char *dst, char *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize * n);\t\n\treturn;\n}\n\nstatic void\nUNICODE_copyswapn (char *dst, char *src, intp n, int swap, int itemsize)\n{\n\tint size = sizeof(Py_UNICODE);\n\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize * n);\n\t\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\tint j, i = size / 2;\n\t\tfor (a = (char *)dst; n>0; n--) {\n\t\t\tb = a + (size-1);\n                        for (j=0; j<i; j++) {\n                                c=*a; *a++ = *b; *b-- = c;\n                        }\n\t\t\ta += i / 2;\n\t\t}\n\t}\n}\n\n\nstatic void\nOBJECT_copyswap (PyObject **dst, PyObject **src, int swap, int itemsize)\n{\n        OBJECT_copyswapn(dst, src, 1, swap, itemsize);\n}\n\nstatic void\nSTRING_copyswap (char *dst, char *src, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize);\n\t\n}\n\n/* ignore swap */\nstatic void\nVOID_copyswap (char *dst, char *src, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize);\t\n\treturn;\n}\n\nstatic void\nUNICODE_copyswap (char *dst, char *src, int swap, int itemsize)\n{\n\tint size = sizeof(Py_UNICODE);\n\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize);\n\t\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\tint j, i = size / 2;\n                a = (char *)dst;\n                b = a + (size-1);\n                for (j=0; j<i; j++) {\n                        c=*a; *a++ = *b; *b-- = c;\n                }\n\t}\n}\n\n\n/****************** nonzero **********************************/\n\n/**begin repeat\n#fname=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE#\n#type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble#\n*/\nstatic Bool \n@fname@_nonzero (@type@ *ip, PyArrayObject *ap)\n{\n\t@type@ t1;\n\tif (ap==NULL || PyArray_ISBEHAVED_RO(ap))\n\t\treturn (Bool) (*ip != 0);\n\telse {\n\t\t/* don't worry about swap, since we are just testing\n\t\t   whether or not equal to 0 */\n\t\tmemcpy(&t1, ip, sizeof(@type@));\n\t\treturn (Bool) (t1 != 0);\n\t}\n}\n/**end repeat**/\n\n#define WHITESPACE \" \\t\\n\\r\\v\\f\"\n#define WHITELEN 6\n\nstatic Bool\nPy_STRING_ISSPACE(char ch) \n{\n\tchar white[] = WHITESPACE;\n\tint j;\n\tBool space=FALSE;\n\tfor (j=0; j<WHITELEN; j++) {\t\n\t\tif (ch == white[j]) {\t\n\t\t\tspace=TRUE;\t\n\t\t\tbreak;\t\t\n\t\t}\t\t\t\n\t}\t\t\t\t\n\treturn space;\n}\n\nstatic Bool\nSTRING_nonzero (char *ip, PyArrayObject *ap)\n{\n\tint len = ap->itemsize;\n\tint i;\n\tBool nonz = FALSE;\n\n\tfor (i=0; i<len; i++) {\n\t\tif (!Py_STRING_ISSPACE(*ip)) {\n\t\t\tnonz = TRUE;\n\t\t\tbreak;\n\t\t}\n\t\tip++;\n\t}\n\treturn nonz;\n}\n\nstatic Bool\nUNICODE_nonzero (Py_UNICODE *ip, PyArrayObject *ap)\n{\n\tint len = ap->itemsize >> 1;\n\tint i;\n\tBool nonz = FALSE;\n\t\n\tfor (i=0; i<len; i++) {\n\t\tif (!Py_UNICODE_ISSPACE(*ip)) {\n\t\t\tnonz = TRUE;\n\t\t\tbreak;\n\t\t}\n\t\tip++;\n\t}\n\treturn nonz;\n}\n\nstatic Bool\nOBJECT_nonzero (PyObject **ip, PyArrayObject *ap)\n{\n\treturn (Bool) PyObject_IsTrue(*ip);\n}\n\n/* If subclass has _nonzero method call it with buffer\n   object wrapping current item.  Otherwise, just compare with '\\0'.\n*/\nstatic Bool\nVOID_nonzero (char *ip, PyArrayObject *ap)\n{\n\tint i;\n\tint len = ap->itemsize;\n\tBool nonz = FALSE;\n        PyObject *u=NULL;\n        int res;\n        PyObject *pyres=NULL;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj, \n\t\t\t\t\t      \"_nonzero\");\n        PyObject *args=NULL;\n\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n\t\t/* Default behavior */\n\t\tPy_XDECREF(meth);\n\t\tfor (i=0; i<len; i++) {\n\t\t\tif (*ip != '\\0') {\n\t\t\t\tnonz = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tip++;\n\t\t}\n\t\treturn nonz;\n        }\n\n        if (len < 0) return FALSE;\n\t\n        u = PyBuffer_FromMemory(ip, len);\n        if ((u==NULL)) {Py_DECREF(meth); return FALSE;}\n\n        args = Py_BuildValue(\"OO\",u, ap);\n        pyres = PyObject_CallObject(meth, args);\n\tPy_DECREF(args);\n\tPy_DECREF(u);\n\tPy_DECREF(meth);\n        if (pyres==NULL) return FALSE;\n        res = (int) PyInt_AsLong(pyres);\n\tPy_DECREF(pyres);\n        if (PyErr_Occurred()) return FALSE;\n\n\treturn (Bool) res;\n}\n\n\n/****************** compare **********************************/\n\n/**begin repeat\n#fname=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\n\nstatic int\n@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap) \n{\n        @type@ t1, t2;\n\n        if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {\n                return *ip1 < *ip2 ? -1 : *ip1 == *ip2 ? 0 : 1;\n        }\n        else { \n\t\tint size = ap->itemsize;\n\t\tBool swap = !PyArray_ISNOTSWAPPED(ap);\n\t\t/* copy to local, aligned variable */\n                copy_and_swap(&t1, ip1, size, 1, 0, swap);\n\t\tcopy_and_swap(&t2, ip2, size, 1, 0, swap);\n\t\treturn t1 < t2 ? -1 : t1 == t2 ? 0 : 1;\n        }\n}\n\n/**end repeat**/\n\n/* compare imaginary part first, then complex if equal imaginary  */\n/**begin repeat \n#fname=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#type= float, double, longdouble#\n*/\n\nstatic int\n@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap) \n{\n        @type@ t1, t2;\n\n        if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {\n\t\tif (*ip1 == *ip2) {\n\t\t\treturn ip1[1]<ip2[1] ? -1 : (ip1[1] == ip2[1] ? 0 : 1);\n\t\t}\n\t\telse {\n\t\t\treturn *ip1 < *ip2 ? -1 : 1;\n\t\t}\n        }\n        else { \n\t\tint size = ap->itemsize >> 1;\n\t\tBool swap = !PyArray_ISNOTSWAPPED(ap);\n\t\t/* copy to local, aligned variable */\n                copy_and_swap(&t1, ip1, size, 1, 0, swap);\n\t\tcopy_and_swap(&t2, ip2, size, 1, 0, swap);\n\t\tif (t1 == t2) {\n\t\t\tcopy_and_swap(&t1, ip1+1, size, 1, 0, swap);\n\t\t\tcopy_and_swap(&t2, ip2+1, size, 1, 0, swap);\n\t\t\treturn (t1 < t2 ? -1 : (t1 == t2 ? 0 : 1));\n\t\t}\n\t\telse {\n\t\t\treturn t1 < t2 ? -1 : 1;\n\t\t}\n        }\n}\n /**end repeat**/\n\nstatic int \nOBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *ap) \n{ \n\treturn PyObject_Compare(*ip1, *ip2);\n}\n\nstatic int \nSTRING_compare(char *ip1, char *ip2, PyArrayObject *ap)\n{\n\treturn strncmp(ip1, ip2, ap->itemsize);\n}\n\nstatic int \nUNICODE_compare(Py_UNICODE *ip1, Py_UNICODE *ip2, PyArrayObject *ap)\n{\n\tPyObject *u=NULL, *v=NULL;\n\tint res;\n        int itemsize=ap->itemsize;\n\tif (itemsize < 0) goto fail;\n\tu = PyUnicode_FromUnicode(ip1, itemsize);\n\tv = PyUnicode_FromUnicode(ip2, itemsize);\n\tif ((u==NULL) || (v==NULL)) goto fail;\n\tres = PyObject_Compare(u, v);\n\tPy_DECREF(u);\n\tPy_DECREF(v);\n\treturn res;\n       \n fail:\n\tPy_XDECREF(u);\n\tPy_XDECREF(v);\n\treturn 0;\n}\n\nstatic int\nVOID_compare(void *ip1, void *ip2, PyArrayObject *ap) \n{\n        PyObject *u=NULL, *v=NULL;\n        int res;\n        PyObject *pyres=NULL;\n        int itemsize=ap->itemsize;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj,\n\t\t\t\t\t      \"_compare\");\n        PyObject *args=NULL;\n\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n                PyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Object needs a compare method.\");\n                goto fail;\n        }\n        if (itemsize < 0) goto fail;\n        u = PyBuffer_FromMemory(ip1, itemsize);\n        v = PyBuffer_FromMemory(ip2, itemsize);\n        if ((u==NULL) || (v==NULL)) goto fail;        \n        \n        args = Py_BuildValue(\"OOO\",u,v,ap);\n        \n        pyres = PyObject_CallObject(meth, args);\n        if (pyres==NULL) goto fail;\n        res = PyInt_AsLong(pyres);\n        if (PyErr_Occurred()) goto fail;        \n\n        Py_DECREF(meth);\n        Py_DECREF(args);\n        Py_DECREF(pyres);\n        Py_DECREF(u);\n        Py_DECREF(v);\n        return res;\n\n fail:\n        Py_XDECREF(pyres);\n        Py_XDECREF(meth);\n        Py_XDECREF(args);\n        Py_XDECREF(u);\n        Py_XDECREF(v);\n        return 0; \n}\n\n/****************** argfunc **********************************/\n\n/**begin repeat\n\n#fname= BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#\n#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble#\n#incr= ip++*14, ip+=2*3#\n*/\n\nstatic int\n@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip)\n{\n\tregister intp i;\n\t@type@ mp=*ip;\n\t*max_ind=0;\n\tfor (i=1; i<n; i++) {\n\t\t@incr@;\n\t\tif (*ip > mp) {\n\t\t\tmp = *ip;\n\t\t\t*max_ind = i;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**end repeat**/\n\nstatic int \nOBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *aip) \n{\n\tregister intp i; \n\tPyObject *mp=ip[0]; *max_ind=0;\n\tfor(i=1; i<n; i++) { \n\t\tip++;\n\t\tif (PyObject_Compare(*ip,mp) > 0) { \n\t\t\tmp = *ip; \n\t\t\t*max_ind=i;\n\t\t} \n\t} \n\treturn 0;\n}\n\n\n/**begin repeat\n\n#fname= STRING, UNICODE, VOID#\n#type= char, Py_UNICODE, void#\n\n*/\nstatic int \n@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) \n{\n\tregister intp i; \n\tint elsize = aip->itemsize;\n\t@type@ *mp = (@type@ *)malloc(elsize);\n\t\n\tif (mp==NULL) return 0;\n\tmemcpy(mp, ip, elsize);\n\t*max_ind = 0;\n\tfor(i=1; i<n; i++) { \n\t\tip += elsize;\n\t\tif (@fname@_compare(ip,mp,aip) > 0) { \n\t\t\tmemcpy(mp, ip, elsize);\n\t\t\t*max_ind=i;\n\t\t} \n\t} \n\treturn 0;\n}\n\n/**end repeat**/\n\n\n/**begin repeat\n\n#name=BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE#\n#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n#out= Bool, intp, uintp, intp, uintp, intp, uintp, intp, uintp, longlong, ulonglong, float, double, longdouble#\n*/\n\nstatic void\n@name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, \n\t   void *ignore)\n{\n\t@out@ tmp=(@out@)0.0;\n\tint i;\n\tfor(i=0;i<n;i++,ip1+=is1,ip2+=is2) { \n\t\ttmp += (@out@)(*((@type@ *)ip1)) * \\\n\t\t\t(@out@)(*((@type@ *)ip2));\n\t}\t\t\t\t\t\t\t\n\t*((@out@ *)op) = tmp;\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#name=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#type= float, double, longdouble#\n*/\n\nstatic void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,\n\t\t       char *op, intp n, void *ignore) \n{\t\t\t\t\n\t@type@ tmpr=(@type@)0.0, tmpi=(@type@)0.0; \n\tintp i;\t\n\tfor(i=0;i<n;i++,ip1+=is1,ip2+=is2) {\n\t\ttmpr += ((@type@ *)ip1)[0] * ((@type@ *)ip2)[0]\t\n\t\t\t- ((@type@ *)ip1)[1] * ((@type@ *)ip2)[1]; \n\t\ttmpi += ((@type@ *)ip1)[1] * ((@type@ *)ip2)[0] \n\t\t\t+ ((@type@ *)ip1)[0] * ((@type@ *)ip2)[1];\n\t}\t\t\t\t\t\t\t\n\t((@type@ *)op)[0] = tmpr; ((@type@ *)op)[1] = tmpi;\n}   \n\n/**end repeat**/\n\nstatic void \nOBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,\n\t   void *ignore) \n{\n\tintp i;\n\tPyObject *tmp1, *tmp2, *tmp=NULL;\n\tPyObject **tmp3;\n\tfor(i=0;i<n;i++,ip1+=is1,ip2+=is2) { \n\t\ttmp1 = PyNumber_Multiply(*((PyObject **)ip1), \n\t\t\t\t\t *((PyObject **)ip2));\n\t\tif (!tmp1) { Py_XDECREF(tmp); return;}\n\t\tif (i == 0) {\n\t\t\ttmp = tmp1;\n\t\t} else {\n\t\t\ttmp2 = PyNumber_Add(tmp, tmp1);\n\t\t\tPy_XDECREF(tmp);\n\t\t\tPy_XDECREF(tmp1);\n\t\t\tif (!tmp2) return;\n\t\t\ttmp = tmp2;\n\t\t}\n\t} \n\ttmp3 = (PyObject**) op;\n\ttmp2 = *tmp3;\n\t*((PyObject **)op) = tmp;\n\tPy_XDECREF(tmp2);\n}\n\n\n#define _ALIGN(type) offsetof(struct {char c; type v;},v)\n\n\n/**begin repeat\n\n#from= VOID, STRING, UNICODE#\n#align= char, char, Py_UNICODE#\n#NAME= Void, String, Unicode#\n*/\n\nstatic PyArray_Descr @from@_Descr = { \n                                      &Py@NAME@ArrType_Type,\n\t\t\t\t      PyArray_@from@LTR,\n\t\t\t\t      PyArray_@from@LTR,\n\t\t\t\t      PyArray_@from@, 0,\n\t\t\t\t      _ALIGN(@align@),\n{\n\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BOOL, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BYTE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UBYTE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_SHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_USHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_INT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UINT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONG,\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_FLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_DOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CFLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CLONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_OBJECT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_STRING, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UNICODE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_VOID\n\t},\n\t\t\t\t      (PyArray_GetItemFunc*)@from@_getitem, \n\t\t\t\t      (PyArray_SetItemFunc*)@from@_setitem,\n\t\t\t\t      (PyArray_CompareFunc*)@from@_compare, \n\t\t\t\t      (PyArray_ArgFunc*)@from@_argmax,\n\t\t\t\t      (PyArray_DotFunc*)NULL, \n\t\t\t\t      (PyArray_ScanFunc*)@from@_scan,\n\t\t\t\t      (PyArray_CopySwapNFunc*)@from@_copyswapn,\n                                      (PyArray_CopySwapFunc*)@from@_copyswap,\n\t\t\t\t      (PyArray_NonzeroFunc*)@from@_nonzero,\n};\n\n/**end repeat**/\n\n\n/**begin repeat\n\n#from= BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT#\n#num= 1*14,2*3,1#\n#fromtyp= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble, PyObject *#\n#NAME= Bool, Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, Object#\n#kind= GENBOOL, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, FLOATING, FLOATING, FLOATING, COMPLEX, COMPLEX, COMPLEX, OBJECT#\n*/\n\nstatic PyArray_Descr @from@_Descr = { \n\t\t\t\t      &Py@NAME@ArrType_Type,\n\t\t\t\t      PyArray_@kind@LTR,\n\t\t\t\t      PyArray_@from@LTR,\n\t\t\t\t      PyArray_@from@, \n\t\t\t\t      @num@*sizeof(@fromtyp@), \n\t\t\t\t      _ALIGN(@fromtyp@),\n{\n\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BOOL, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BYTE,\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UBYTE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_SHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_USHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_INT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UINT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONG,\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_FLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_DOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CFLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CLONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_OBJECT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_STRING, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UNICODE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_VOID\n\t},\n\t\t\t\t      (PyArray_GetItemFunc*)@from@_getitem, \n\t\t\t\t      (PyArray_SetItemFunc*)@from@_setitem,\n\t\t\t\t      (PyArray_CompareFunc*)@from@_compare, \n\t\t\t\t      (PyArray_ArgFunc*)@from@_argmax,\n\t\t\t\t      (PyArray_DotFunc*)@from@_dot, \n\t\t\t\t      (PyArray_ScanFunc*)@from@_scan,\n\t\t\t\t      (PyArray_CopySwapNFunc*)@from@_copyswapn,\n\t\t\t\t      (PyArray_CopySwapFunc*)@from@_copyswap,\n\t\t\t\t      (PyArray_NonzeroFunc*)@from@_nonzero,\n};\n\n/**end repeat**/\n\nstatic PyArray_Descr *descrs[] = {\n\t&BOOL_Descr,\n\t&BYTE_Descr,\n\t&UBYTE_Descr,\n\t&SHORT_Descr, \n\t&USHORT_Descr, \n\t&INT_Descr, \n\t&UINT_Descr, \n\t&LONG_Descr, \n\t&ULONG_Descr,\n\t&LONGLONG_Descr,\n\t&ULONGLONG_Descr,\n\t&FLOAT_Descr, \n\t&DOUBLE_Descr,\n\t&LONGDOUBLE_Descr,\n\t&CFLOAT_Descr, \n\t&CDOUBLE_Descr, \n\t&CLONGDOUBLE_Descr,\n\t&OBJECT_Descr, \n\t&STRING_Descr, \n\t&UNICODE_Descr,\n\t&VOID_Descr,\n};\n\nstatic PyArray_Descr **userdescrs=NULL;\n\nstatic PyArray_Descr *\nPyArray_DescrFromType(int type) {\n\tif (type < PyArray_NTYPES) {\n\t\treturn descrs[type];\n\t}\n\telse if (type == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Invalid type for array\"); \n\t\treturn NULL;\n\t}\n\telse if PyTypeNum_ISUSERDEF(type) {\n\t\treturn userdescrs[type-PyArray_USERDEF];\n\t} \n\telse {\n\t\tswitch(type) {\n                case PyArray_INTPLTR: return descrs[PyArray_INTP];\n\t\tcase PyArray_DOUBLELTR: return descrs[PyArray_DOUBLE];\n\t\tcase PyArray_CDOUBLELTR: return descrs[PyArray_CDOUBLE];\n\n                case PyArray_UINTPLTR: return descrs[PyArray_UINTP];\n                case PyArray_BOOLLTR: return descrs[PyArray_BOOL];\n\t\tcase PyArray_BYTELTR: return descrs[PyArray_BYTE];\n\t\tcase PyArray_UBYTELTR: return descrs[PyArray_UBYTE];\n\t\tcase PyArray_SHORTLTR: return descrs[PyArray_SHORT];\n\t\tcase PyArray_USHORTLTR: return descrs[PyArray_USHORT];\n\t\tcase PyArray_INTLTR: return descrs[PyArray_INT];\n\t\tcase PyArray_UINTLTR: return descrs[PyArray_UINT];\n\t\tcase PyArray_LONGLTR: return descrs[PyArray_LONG];\n                case PyArray_ULONGLTR: return descrs[PyArray_ULONG];\n                case PyArray_LONGLONGLTR: return descrs[PyArray_LONGLONG];\n                case PyArray_ULONGLONGLTR: return descrs[PyArray_ULONGLONG];\n\t\tcase PyArray_FLOATLTR: return descrs[PyArray_FLOAT];\n                case PyArray_LONGDOUBLELTR: return descrs[PyArray_LONGDOUBLE];\n\t\tcase PyArray_CFLOATLTR: return descrs[PyArray_CFLOAT];\n                case PyArray_CLONGDOUBLELTR: \n\t\t\treturn descrs[PyArray_CLONGDOUBLE];\n\t\tcase PyArray_OBJECTLTR: return descrs[PyArray_OBJECT];\n\t\tcase PyArray_STRINGLTR: return descrs[PyArray_STRING];\n                case PyArray_UNICODELTR: return descrs[PyArray_UNICODE];\n\t        case PyArray_VOIDLTR: return descrs[PyArray_VOID];\n\t\tdefault:\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"Invalid type for array\");\t\n\t\t\treturn NULL;\n\t\t}\n\t}\n}\n\n\n\nstatic int\nset_typeinfo(PyObject *dict)\n{\n\tPyObject *infodict, *s;\n\n\t/* Set a dictionary with type information */\n\tinfodict = PyDict_New();\n\tif (infodict == NULL) return -1;\n\n#define BITSOF_INTP CHAR_BIT*SIZEOF_PY_INTPTR_T\n#define BITSOF_BYTE CHAR_BIT\n\n/**begin repeat \n\n#name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,INTP,UINTP,LONG,ULONG,LONGLONG,ULONGLONG#\n#uname=BOOL,BYTE*2,SHORT*2,INT*2,INTP*2,LONG*2,LONGLONG*2#\n#Name=Bool,Byte,UByte,Short,UShort,Int,UInt,Intp,UIntp,Long,ULong,LongLong,ULongLong#\n#type=Bool,byte,ubyte,short,ushort,int,uint,intp,uintp,long,ulong,longlong,ulonglong#\n#max=1,MAX_BYTE,MAX_UBYTE,MAX_SHORT,MAX_USHORT,MAX_INT,PyLong_FromUnsignedLong(MAX_UINT),PyLong_FromLongLong((longlong) MAX_INTP),PyLong_FromUnsignedLongLong((ulonglong) MAX_UINTP),MAX_LONG,PyLong_FromUnsignedLong((unsigned long) MAX_ULONG),PyLong_FromLongLong((longlong) MAX_LONGLONG), PyLong_FromUnsignedLongLong((ulonglong) MAX_ULONGLONG)#\n#min=0,MIN_BYTE,0,MIN_SHORT,0,MIN_INT,0,PyLong_FromLongLong((longlong) MIN_INTP),0,MIN_LONG,0,PyLong_FromLongLong((longlong) MIN_LONGLONG),0#\n#cx=i*6,N,N,N,l,N,N,N#\n#cn=i*7,N,i,l,i,N,i#\n*/\n       \tPyDict_SetItemString(infodict, \"@name@\", \n\t\t\t     s=Py_BuildValue(\"ciii@cx@@cn@O\", \n\t\t\t\t\t     PyArray_@name@LTR, \n\t\t\t\t\t     PyArray_@name@,\n\t\t\t\t\t     BITSOF_@uname@,\n\t\t\t\t\t     _ALIGN(@type@),\n\t\t\t\t\t     @max@, @min@,\n\t\t\t\t     (PyObject *)&Py@Name@ArrType_Type));\n\tPy_DECREF(s); \n/**end repeat**/\n\n#define BITSOF_CFLOAT 2*BITSOF_FLOAT\n#define BITSOF_CDOUBLE 2*BITSOF_DOUBLE\n#define BITSOF_CLONGDOUBLE 2*BITSOF_LONGDOUBLE\n\n/**begin repeat\n\n#type=float,double,longdouble,cfloat,cdouble,clongdouble#\n#name=FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#\n#Name=Float,Double,LongDouble,CFloat,CDouble,CLongDouble#\n*/\n \tPyDict_SetItemString(infodict, \"@name@\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_@name@LTR, \n\t\t\t\t\t     PyArray_@name@, BITSOF_@name@,\n\t\t\t\t\t     _ALIGN(@type@),\n                                             (PyObject *)\\\n                                             &Py@Name@ArrType_Type));\n\tPy_DECREF(s);\n/**end repeat**/\n\t\n\tPyDict_SetItemString(infodict, \"OBJECT\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_OBJECTLTR, \n\t\t\t\t\t     PyArray_OBJECT, \n\t\t\t\t\t     sizeof(PyObject *)*CHAR_BIT,\n\t\t\t\t\t     _ALIGN(PyObject *),\n                                             (PyObject *)\\\n                                             &PyObjectArrType_Type));\n\tPy_DECREF(s);\n\tPyDict_SetItemString(infodict, \"STRING\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_STRINGLTR, \n\t\t\t\t\t     PyArray_STRING, 0,\n\t\t\t\t\t     _ALIGN(char),\n                                             (PyObject *)\\\n                                             &PyStringArrType_Type));\n\tPy_DECREF(s);\n\tPyDict_SetItemString(infodict, \"UNICODE\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_UNICODELTR, \n\t\t\t\t\t     PyArray_UNICODE, 0,\n\t\t\t\t\t     _ALIGN(Py_UNICODE),\n                                             (PyObject *)\\\n                                             &PyUnicodeArrType_Type));\t\n\tPy_DECREF(s);\n\tPyDict_SetItemString(infodict, \"VOID\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_VOIDLTR, \n\t\t\t\t\t     PyArray_VOID, 0,\n\t\t\t\t\t     _ALIGN(char),\n                                             (PyObject *)\\\n                                             &PyVoidArrType_Type));\t\n\tPy_DECREF(s);\n\n#define SETTYPE(name)                           \\\n        Py_INCREF(&Py##name##ArrType_Type);     \\\n        PyDict_SetItemString(infodict, #name,   \\\n                             (PyObject *)&Py##name##ArrType_Type);\n\n        SETTYPE(Generic)\n        SETTYPE(Numeric)\n        SETTYPE(Integer)\n\tSETTYPE(Inexact)\n        SETTYPE(SignedInteger)\n        SETTYPE(UnsignedInteger)\n        SETTYPE(Floating)\n        SETTYPE(ComplexFloating)\n        SETTYPE(Flexible)\n        SETTYPE(Character)\n\n#undef SETTYPE       \t\n\n\tPyDict_SetItemString(dict, \"typeinfo\", infodict);\n\tPy_DECREF(infodict);\n\treturn 0;\n}\n\n\n",
                "source_code_before": "/* -*- c -*- */\n\nstatic ulong\nMyPyLong_AsUnsignedLong(PyObject *vv)\n{\n\tif ((vv != NULL) && PyInt_Check(vv)) {\n\t\tlong val = PyInt_AsLong(vv);\n\t\tif (val < 0) {\n\t\t\tPyErr_SetString(PyExc_OverflowError,\n\t\t\t\"can't convert negative value to unsigned long\");\n\t\t\treturn (ulong) -1;\n\t\t}\n\t\treturn val;\n\t}\n\treturn PyLong_AsUnsignedLong(vv);\t\n}\n\nstatic ulonglong\nMyPyLong_AsUnsignedLongLong(PyObject *vv)\n{\n\tif ((vv != NULL) && PyInt_Check(vv)) {\n\t\tlonglong val = PyInt_AsLong(vv);\n\t\tif (val < 0) {\n\t\t\tPyErr_SetString(PyExc_OverflowError,\n\t\t\t\"can't convert negative value to unsigned long\");\n\t\t\treturn (ulonglong) -1;\n\t\t}\n\t\treturn val;\n\t}\n\treturn PyLong_AsUnsignedLongLong(vv);\t\n}\n\n/****************** getitem and setitem **********************/\n\n/**begin repeat\n\n#TYP=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,LONG,UINT,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE#\n#func1=PyBool_FromLong, PyInt_FromLong*6, PyLong_FromUnsignedLong*2, PyLong_FromLongLong, PyLong_FromUnsignedLongLong, PyFloat_FromDouble*2#\n#func2=PyObject_IsTrue, PyInt_AsLong*6, MyPyLong_AsUnsignedLong*2, PyLong_AsLongLong, MyPyLong_AsUnsignedLongLong, PyFloat_AsDouble*2#\n#typ=Bool, byte, ubyte, short, ushort, int, long, uint, ulong, longlong, ulonglong, float, double#\n#typ1=long*7, ulong*2, longlong, ulonglong, float, double#\n#kind=Bool, Byte, UByte, Short, UShort, Int, Long, UInt, ULong, LongLong, ULongLong, Float, Double#\n*/\n\nstatic PyObject * \n@TYP@_getitem(char *ip, PyArrayObject *ap) {\n        @typ@ t1;\n\n\tif ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {\n                t1 = *((@typ@ *)ip);\n                return @func1@((@typ1@)t1);\n\t}\n\telse {\n                ap->descr->copyswap(&t1, ip, !PyArray_ISNOTSWAPPED(ap),\n\t\t\t\t    ap->itemsize);\n                return @func1@((@typ1@)t1);\n\t}\n}\nstatic int \n@TYP@_setitem(PyObject *op, char *ov, PyArrayObject *ap) {\n        @typ@ temp;  /* ensures alignment */\n\n        if (PyArray_IsScalar(op, @kind@)) {\n                temp = ((Py@kind@ScalarObject *)op)->obval;\n        }\n        else {\n                temp = (@typ@)@func2@(op);\n        }\n        if (PyErr_Occurred()) return -1;\n        if (ap == NULL || PyArray_ISBEHAVED(ap)) \n                *((@typ@ *)ov)=temp;\n        else {\n                ap->descr->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), \n\t\t\t\t    ap->itemsize);\n        }\n        \n        return 0;\n}\n\n/**end repeat**/\n\n\n/**begin repeat \n\n#TYP=CFLOAT,CDOUBLE#\n#typ=float, double#\n*/\n\nstatic PyObject * \n@TYP@_getitem(char *ip, PyArrayObject *ap) {\n        @typ@ t1, t2;\n\n        if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {                \n                return PyComplex_FromDoubles((double)((@typ@ *)ip)[0], \n                                             (double)((@typ@ *)ip)[1]);\n        }\n        else {\n\t\tint size = sizeof(@typ@);\n\t\tBool swap = !PyArray_ISNOTSWAPPED(ap);\n                copy_and_swap(&t1, ip, size, 1, 0, swap);\n                copy_and_swap(&t2, ip+size, size, 1, 0, swap);\n                return PyComplex_FromDoubles((double)t1, (double)t2);\n        }\n}\n/**end repeat**/\n\n/**begin repeat \n\n#TYP=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#typ=float, double, longdouble#\n#kind=CFloat, CDouble, CLongDouble#\n*/\nstatic int \n@TYP@_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n        Py_complex oop;\n        PyObject *op2;\n        c@typ@ temp;\n\tint rsize;\n        \n        if (!(PyArray_IsScalar(op, @kind@))) {\n                if (PyArray_CheckScalar(op))                         \n                        op2 = ((PyArrayObject *)op)->descr->getitem     \\\n                                (((PyArrayObject *)op)->data, \n                                 (PyArrayObject *)op);\n                else { \n                        op2 = op; Py_INCREF(op);\n                }\n                oop = PyComplex_AsCComplex (op2);\n                Py_DECREF(op2);\n                if (PyErr_Occurred()) return -1;\n                temp.real = (@typ@) oop.real;\n                temp.imag = (@typ@) oop.imag;  \n        }\n\telse {\n                temp = ((Py@kind@ScalarObject *)op)->obval;\n        }\n\t\n        memcpy(ov, &temp, ap->itemsize);\n        if (!PyArray_ISNOTSWAPPED(ap))\n                byte_swap_vector(ov, 2, sizeof(@typ@));\n\t\n\trsize = sizeof(@typ@);\n\tcopy_and_swap(ov, &temp, rsize, 2, rsize, !PyArray_ISNOTSWAPPED(ap));\n        return 0;\n}\n/**end repeat**/\n\nstatic PyObject * \nLONGDOUBLE_getitem(char *ip, PyArrayObject *ap) \n{\n        return PyArray_Scalar(ip, PyArray_LONGDOUBLE, sizeof(longdouble), \n                              !PyArray_ISNOTSWAPPED(ap));\n}\n\nstatic int \nLONGDOUBLE_setitem(PyObject *op, char *ov, PyArrayObject *ap) {\n        longdouble temp;  /* ensures alignment */\n\n        if (PyArray_IsScalar(op, LongDouble)) {\n                temp = ((PyLongDoubleScalarObject *)op)->obval;\n        }\n        else {\n                temp = (longdouble)PyFloat_AsDouble(op);\n        }\n        if (PyErr_Occurred()) return -1;\n        if (ap == NULL || PyArray_ISBEHAVED(ap)) \n                *((longdouble *)ov)=temp;\n        else {\n                copy_and_swap(ov, &temp, ap->itemsize, 1, 0,\n                              !PyArray_ISNOTSWAPPED(ap));\n        }\n        \n        return 0;\n}\n\nstatic PyObject * \nCLONGDOUBLE_getitem(char *ip, PyArrayObject *ap) \n{\n        return PyArray_Scalar(ip, PyArray_CLONGDOUBLE, sizeof(clongdouble), \n                              !PyArray_ISNOTSWAPPED(ap));\n}\n\n\n\n/* UNICODE */\nstatic PyObject * \nUNICODE_getitem(char *ip, PyArrayObject *ap) \n{\n\tPyObject *obj;\n\tsize_t size = sizeof(Py_UNICODE);\n\t\n\tobj = PyUnicode_FromUnicode((const Py_UNICODE *)ip, \n\t\t\t\t    ap->itemsize / size);\n\tif (!PyArray_ISNOTSWAPPED(ap) && (obj != NULL)) {\n\t\tbyte_swap_vector(PyUnicode_AS_UNICODE(obj),\n\t\t\t\t ap->itemsize / size, size);\n\t}\n\treturn obj;\n}\n\nstatic int \nUNICODE_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n        PyObject *temp;\n\tPy_UNICODE *ptr;\n\tint datalen;\n\tsize_t size = sizeof(Py_UNICODE);\n\n\tif ((temp=PyObject_Unicode(op)) == NULL) return -1;\n\n\tptr = PyUnicode_AS_UNICODE(temp);\n\tif ((ptr == NULL) || (PyErr_Occurred())) {\n\t\tPy_DECREF(temp);\n\t\treturn -1;\n\t}\n\tdatalen = PyUnicode_GET_DATA_SIZE(op);\n\n\tmemcpy(ov, ptr, MIN(ap->itemsize, datalen));\n\t/* Fill in the rest of the space with 0 */\n\tif (ap->itemsize > datalen) {\n\t\tmemset(ov + datalen, 0, (ap->itemsize - datalen));\n\t}\n\n\tif (!PyArray_ISNOTSWAPPED(ap)) \n\t\tbyte_swap_vector(ov, ap->itemsize / size, size);\n\t\n\tPy_DECREF(temp);\n\treturn 0;\n}\n\n/* STRING */\nstatic \nPyObject * \nSTRING_getitem(char *ip, PyArrayObject *ap) \n{\n\treturn PyString_FromStringAndSize(ip,ap->itemsize);\n}\n\nstatic int \nSTRING_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n\tchar *ptr;\n\tint len;\n\tPyObject *temp=PyObject_Str(op);\n\t\n\tif (temp == NULL) return -1;\n\t\n\tif (PyString_AsStringAndSize(temp, &ptr, &len) == -1) {\n\t\tPy_DECREF(temp);\n\t\treturn -1;\n\t}\n\tmemcpy(ov, ptr, MIN(ap->itemsize,len));\n\tif (ap->itemsize > len) {\n\t\tmemset(ov + len, 0, (ap->itemsize - len));\n\t}\n\tPy_DECREF(temp);\n\treturn 0;\n}\n\n/* OBJECT */\n\nstatic PyObject * \nOBJECT_getitem(char *ip, PyArrayObject *ap) \n{\n\tPy_INCREF(*(PyObject **)ip);\n\treturn *(PyObject **)ip;\n}\n\nstatic int \nOBJECT_setitem(PyObject *op, char *ov, PyArrayObject *ap) \n{\n\tPy_XDECREF(*(PyObject **)ov);\n\tPy_INCREF(op);\n\t*(PyObject **)ov = op;\n\treturn PyErr_Occurred() ? -1:0;\n}\n\n/* VOID */\n\nstatic PyObject *\nVOID_getitem(char *ip, PyArrayObject *ap)\n{\n        PyObject *u=NULL;\n        PyObject *pyres=NULL;\n\tPyObject *args=NULL;\n        int itemsize=ap->itemsize;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj,\n\t\t\t\t\t      \"_getitem\");\n\n\n\tif (PyArray_ISWRITEABLE(ap))\n\t\tu = PyBuffer_FromReadWriteMemory(ip, itemsize);\n\telse\n\t\tu = PyBuffer_FromMemory(ip, itemsize);\n\tif (u==NULL) goto fail;\n\n\t/* default is to return buffer object pointing to current item */\n\t/*  a view of it */\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n\t\tPy_XDECREF(meth);\n\t\tPyErr_Clear();\n\t\treturn u;        \n\t}\n\n\targs = Py_BuildValue(\"OO\",u, ap);\n\tPy_DECREF(u);\n\tif (args==0) goto fail;\n        pyres = PyObject_CallObject(meth, args);\n\tPy_DECREF(args);\n\tPy_DECREF(meth);\n\treturn pyres;\n\n fail:\n        Py_XDECREF(meth);\n        Py_XDECREF(args);\n        Py_XDECREF(u);\n        return NULL;\n}\n\nstatic int\nVOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)\n{\n        PyObject *u=NULL;\n        PyObject *pyres=NULL;\n        PyObject *args=NULL;\n        int itemsize=ap->itemsize;\n\tint res;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj,\n\t\t\t\t\t      \"_setitem\");\n\n\t/* Default is to use buffer interface to set item */\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n\t\tconst void *buffer;\n\t\tint buflen;\n\t\tPyErr_Clear();\n\t\tres = PyObject_AsReadBuffer(op, &buffer, &buflen);\n\t\tif (res == -1) goto fail;\n\t\tmemcpy(ip, buffer, MIN(buflen, itemsize));\n\t\tPy_XDECREF(meth);\n\t\treturn 0;\n        }\n        u = PyBuffer_FromReadWriteMemory(ip, itemsize);\n\tif (u==NULL) goto fail;\n\targs = Py_BuildValue(\"OOO\",u, op, ap);\n        pyres = PyObject_CallObject(meth, args);\n        if (pyres==NULL) goto fail;\n\tres = 0;\n        if (PyErr_Occurred()) goto fail;        \n\n        Py_DECREF(meth);\n        Py_DECREF(args);\n        Py_DECREF(pyres);\n        Py_DECREF(u);\n        return res;\n\n fail:\n        Py_XDECREF(pyres);\n        Py_XDECREF(meth);\n        Py_XDECREF(args);\n        Py_XDECREF(u);\n        return -1;          \n}\n\n\n/****************** XXX_to_YYY *******************************/        \n\n/* Assumes contiguous, and aligned, from and to */\n\n\n/**begin repeat\n#to=(BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*16#\n#from=BYTE*13,UBYTE*13,SHORT*13,USHORT*13,INT*13,UINT*13,LONG*13,ULONG*13,LONGLONG*13,ULONGLONG*13,FLOAT*13,DOUBLE*13,LONGDOUBLE*13,CFLOAT*13,CDOUBLE*13,CLONGDOUBLE*13#\n#totyp=(byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble)*16#\n#fromtyp=byte*13, ubyte*13, short*13, ushort*13, int*13, uint*13, long*13, ulong*13, longlong*13, ulonglong*13, float*13, double*13, longdouble*13, float*13, double*13, longdouble*13#\n#incr= ip++*166,ip+=2*42#\n*/\nstatic void \n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++) {\n\t\t*op = (@totyp@)*ip;\n\t\t@incr@;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n#from=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#fromtyp=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \n@from@_to_BOOL(@fromtyp@ *ip, Bool *op, intp n, PyArrayObject *aip, \n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++,ip++) {\n\t\t*op = (Bool)(*ip != FALSE);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n#from=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#fromtyp=cfloat, cdouble, clongdouble#\n*/\nstatic void \n@from@_to_BOOL(@fromtyp@ *ip, Bool *op, intp n, PyArrayObject *aip, \n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++,ip++) {\n\t\t*op = (Bool)(((*ip).real != FALSE) && ((*ip).imag != FALSE));\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n#to=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#totyp=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\nstatic void \nBOOL_to_@to@(Bool *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t     PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<n;i++,op++,ip++) {\n\t\t*op = (@totyp@)(*ip != FALSE);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat\n\n#to=(CFLOAT,CDOUBLE,CLONGDOUBLE)*14#\n#from=BOOL*3,BYTE*3,UBYTE*3,SHORT*3,USHORT*3,INT*3,UINT*3,LONG*3,ULONG*3,LONGLONG*3,ULONGLONG*3,FLOAT*3,DOUBLE*3,LONGDOUBLE*3#\n#fromtyp=Bool*3,byte*3, ubyte*3, short*3, ushort*3, int*3, uint*3, long*3, ulong*3, longlong*3, ulonglong*3, float*3, double*3, longdouble*3#\n#totyp= (float, double, longdouble)*14#\n*/\nstatic void \n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip,\n\t       PyArrayObject *aop) {\n\tregister intp i;\n\tfor(i=0;i<n;i++,ip++) {\n\t\t*op++ = (@totyp@)*ip;\n\t\t*op++ = 0.0;\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#to=(CFLOAT,CDOUBLE,CLONGDOUBLE)*3#\n#from=CFLOAT*3,CDOUBLE*3,CLONGDOUBLE*3#\n#totyp=(float, double, longdouble)*3#\n#fromtyp=float*3, double*3, longdouble*3#\n*/\nstatic void \n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip,\n\t       PyArrayObject *aop) {\n\tregister intp i; \n\tfor(i=0;i<2*n;i++,ip++,op++) {\n\t\t*op = (@totyp@)*ip;\n\t}\n}\n\n/**end repeat**/\n\n/**begin repeat \n\n#from=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID, OBJECT#\n#fromtyp=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char, PyObject *#\n#skip= 1*17, aip->itemsize*3, 1#\n*/\nstatic void \n@from@_to_OBJECT(@fromtyp@ *ip, PyObject **op, intp n, PyArrayObject *aip,\n\t\t PyArrayObject *aop)\n{\n\tregister intp i; \n\tint skip=@skip@;\n\tfor(i=0;i<n;i++,ip+=skip,op++) {\n\t\tPy_XDECREF(*op);\n\t\t*op = @from@_getitem((char *)ip, aip);\n\t}\n}\n/**end repeat**/\n\n/**begin repeat \n\n#to=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID#\n#totyp=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char#\n#skip= 1*17, aip->itemsize*3#\n*/\nstatic void \nOBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *aip,\n\t\t PyArrayObject *aop)\n{\n\tregister intp i; \n\tint skip=@skip@;\n\tfor(i=0;i<n;i++,ip++,op+=skip) {\n\t\t@to@_setitem(*ip, (char *)op, aop);\n\t}\n}\n/**end repeat**/\n\n\n\n/**begin repeat\n\n#from=STRING*20, UNICODE*20, VOID*20#\n#fromtyp=char*60#\n#to=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,STRING,UNICODE,VOID)*3#\n#totyp=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, void)*3#\n#oskip=(1*17,aop->itemsize*3)*3#\n*/\n\nstatic void\n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t     PyArrayObject *aop)\n{\n\tregister intp i;\n\tPyObject *temp=NULL;\n\tint skip=aip->itemsize;\n\tint oskip=@oskip@;\n\tfor(i=0; i<n; i++, ip+=skip, op+=oskip) {\n\t\ttemp = @from@_getitem((char *)ip, aip);\n\t\tif (temp==NULL) {\n\t\t\tPy_INCREF(Py_False);\n\t\t\ttemp = Py_False;\n\t\t}\n\t\t@to@_setitem(temp,(char *)op, aop);\n\t\tPy_DECREF(temp);\n\t}\n}\n\n/**end repeat**/\n\n/**begin repeat\n\n#to=STRING*17, UNICODE*17, VOID*17#\n#totyp=char*17, char*17, char*17#\n#from=(BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE)*3#\n#fromtyp=(Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble)*3#\n*/\n\nstatic void\n@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, \n\t     PyArrayObject *aop)\n{\n\tregister intp i;\n\tPyObject *temp=NULL;\n\tint skip=1;\n\tint oskip=aop->itemsize;\n\tfor(i=0; i<n; i++, ip+=skip, op+=oskip) {\n\t\ttemp = @from@_getitem((char *)ip, aip);\n\t\tif (temp==NULL) {\n\t\t\tPy_INCREF(Py_False);\n\t\t\ttemp = Py_False;\n\t\t}\n\t\t@to@_setitem(temp,(char *)op, aop);\n\t\tPy_DECREF(temp);\n\t}\n}\n\n/**end repeat**/\n\n\n/****************** scan *************************************/\n\n/**begin repeat\n\n#fname=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#type=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#\n#format=\"%hd\",\"%hu\",\"%d\",\"%u\",\"%ld\",\"%lu\",LONGLONG_FMT,ULONGLONG_FMT,\"%f\",\"%lf\",\"%Lf\"#\n*/\nstatic int\n@fname@_scan (FILE *fp, @type@ *ip, int itemsize, char *sep, PyArrayObject *ao)\n{\n\tint num;\n\tnum = fscanf(fp, @format@, ip);\n\tif (num != 1) {\n\t\tif (num == 0) return -3;\n\t\tif (num == EOF) return -4;\n\t\treturn -5;\n\t}\n\tif (sep != NULL) {\n\t\tnum = fscanf(fp, sep);\n\t\tif (num == 0) return 0;\n\t\tif (num == EOF) return -1;\n\t}\n\treturn 0;\n}\n\n/**end repeat**/\n\n/**begin repeat\n#fname=BOOL,BYTE,UBYTE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID#\n*/\n#define @fname@_scan NULL\n/**end repeat**/\n\n\n\n/****************** copyswapn *************************************/\n\n/**begin repeat\n\n#fname=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#fsize=SHORT,SHORT,INT,INT,LONG,LONG,LONGLONG,LONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#type=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#\n*/\nstatic void\n@fname@_copyswapn (void *dst, void *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, n*sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\tfor (a = (char *)dst; n>0; n--) {\n#if SIZEOF_@fsize@ == 2\n\t\t\tb = a + 1;\n\t\t\tc = *a; *a++ = *b; *b = c;\n\t\t\ta += 1;\n#elif SIZEOF_@fsize@ == 4\n\t\t\tb = a + 3;\n                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 2;\n#elif SIZEOF_@fsize@ == 8\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\t\t\ta += 4;\n#elif SIZEOF_@fsize@ == 10\n                        b = a + 9;\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                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 5;\n#elif SIZEOF_@fsize@ == 12\n                        b = a + 11;\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                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 6;\n#elif SIZEOF_@fsize@ == 16\n                        b = a + 15;\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                        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\t\t\ta += 8;\n#else\n\t\t\tregister int i, nn;\n                        b = a + (SIZEOF_@fsize@-1);\n\t\t\tnn = SIZEOF_@fsize@ / 2;\n                        for (i=0; i<nn; i++) {\n                                c=*a; *a++ = *b; *b-- = c;\n                        }\n\t\t\ta += nn / 2;\n#endif\t\t\t\n\t\t}\n\t}\n}\n\nstatic void\n@fname@_copyswap (void *dst, void *src, int swap, int itemsize)\n{\n\n\tif (src != NULL) /* copy first if needed */\n                memcpy(dst, src, sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n                a = (char *)dst;\n#if SIZEOF_@fsize@ == 2\n                b = a + 1;\n                c = *a; *a++ = *b; *b = c;\n#elif SIZEOF_@fsize@ == 4\n                b = a + 3;\n                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 8\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#elif SIZEOF_@fsize@ == 10\n                b = a + 9;\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                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 12\n                b = a + 11;\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                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 16\n                b = a + 15;\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                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#else\n\t\t{\n\t\t\tregister int i, nn;\n                \tb = a + (SIZEOF_@fsize@-1);\n                \tnn = SIZEOF_@fsize@ / 2;\n                \tfor (i=0; i<nn; i++) {\n                        \tc=*a; *a++ = *b; *b-- = c;\n                \t}\n\t\t}\n#endif\t\t\t\n        }\n}\n\n\n/**end repeat**/\n\n/**begin repeat\n\n#fname=BOOL, BYTE, UBYTE#\n#type=Bool, byte, ubyte#\n*/\nstatic void\n@fname@_copyswapn (void *dst, void *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, n*sizeof(@type@));\n\t/* ignore swap */\n}\n\nstatic void\n@fname@_copyswap (void *dst, void *src, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, sizeof(@type@));\n\t/* ignore swap */\n}\n\n/**end repeat**/\n\n\n\n/**begin repeat\n\n#fname=CFLOAT,CDOUBLE,CLONGDOUBLE#\n#type=cfloat, cdouble, clongdouble#\n#fsize=FLOAT,DOUBLE,LONGDOUBLE#\n*/\nstatic void\n@fname@_copyswapn (void *dst, void *src, intp n, int swap, int itemsize)\n{\n\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, n*sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\t/* complex type -- swap twice as many */\n\t\tregister intp nn = 2*n;  \n\t\tfor (a = (char *)dst; nn>0; nn--) {\n#if SIZEOF_@fsize@ == 4\n\t\t\tb = a + 3;\n                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 2;\n#elif SIZEOF_@fsize@ == 8\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\t\t\ta += 4;\n#elif SIZEOF_@fsize@ == 10\n                        b = a + 9;\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                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 5;\n#elif SIZEOF_@fsize@ == 12\n                        b = a + 11;\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                        c = *a; *a++ = *b; *b-- = c;\n                        c = *a; *a++ = *b; *b   = c;\n\t\t\ta += 6;\n#elif SIZEOF_@fsize@ == 16\n                        b = a + 15;\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                        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\t\t\ta += 8;\n#else\n\t\t\tregister int i, kn;\n\n                        b = a + (SIZEOF_@fsize@-1);\n\t\t\tkn = SIZEOF_@fsize@ / 2;\n                        for (i=0; i<kn; i++) {\n                                c=*a; *a++ = *b; *b-- = c;\n                        }\n\t\t\ta += kn / 2;\n#endif\t\t\t\n\t\t}\n\t}\n}\n\nstatic void\n@fname@_copyswap (void *dst, void *src, int swap, int itemsize)\n{\n\tif (src != NULL) /* copy first if needed */\n\t\tmemcpy(dst, src, sizeof(@type@));\n\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\ta = (char *)dst;\n#if SIZEOF_@fsize@ == 4\n                b = a + 3;\n                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n                a += 2;\n                b = a + 3;\n                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 8\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                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#elif SIZEOF_@fsize@ == 10\n                b = a + 9;\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                c = *a; *a++ = *b; *b   = c;\n                a += 5;\n                b = a + 9;\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                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 12\n                b = a + 11;\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                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n                a += 6;\n                b = a + 11;\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                c = *a; *a++ = *b; *b-- = c;\n                c = *a; *a++ = *b; *b   = c;\n#elif SIZEOF_@fsize@ == 16\n                b = a + 15;\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                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                a += 8;\n                b = a + 15;\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                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#else\n\t\t{\n\t\t\tregister int i, nn;\n                \tb = a + (SIZEOF_@fsize@-1);\n                \tnn = SIZEOF_@fsize@ / 2;\n                \tfor (i=0; i<nn; i++) {\n                        \tc=*a; *a++ = *b; *b-- = c;\n                \t}\n                \ta += nn / 2;\n                \tb = a + (SIZEOF_@fsize@-1);\n                \tnn = SIZEOF_@fsize@ / 2;\n                \tfor (i=0; i<nn; i++) {\n                        \tc=*a; *a++ = *b; *b-- = c;\n                \t}\n\t\t}\n#endif\t\t\t\n        }\n}\n\n\n/**end repeat**/\n\nstatic void\nOBJECT_copyswapn (PyObject **dst, PyObject **src, intp n, int swap, int itemsize)\n{\n\tregister int i, nn=n;\n\tPyObject **dp=dst, **sp=src;\n\tPyObject *meth=NULL;\n\tPyObject *ret=NULL;\n\tif (src != NULL) {\n\t\tfor (i=0; i<nn; i++) {\n\t\t\tPy_XDECREF(*dp);\n\t\t\tPy_INCREF(*sp);\n\t\t\t*dp++ = *sp++;\n\t\t}\n\t}\n\tif (swap) {\n\t\t/* get .byteswap methods if they exist */\n\t\tdp = dst;\n\t\tfor (i=0; i<nn; i++) {\n\t\t\tmeth = PyObject_GetAttrString(*dp, \"byteswap\");\n\t\t\tif ((meth != NULL) && PyCallable_Check(meth)) {\n\t\t\t\tret = PyObject_CallObject(meth, NULL);\n\t\t\t\tPy_XDECREF(ret);\n\t\t\t}\n\t\t\tPy_XDECREF(meth);\n\t\t\tdp++;\n\t\t}\n\t}\n\treturn;\n}\n\n/* ignore swap */\nstatic void\nSTRING_copyswapn (char *dst, char *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize * n);\n\t\n\treturn;\n}\n\n/* ignore swap */\nstatic void\nVOID_copyswapn (char *dst, char *src, intp n, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize * n);\t\n\treturn;\n}\n\nstatic void\nUNICODE_copyswapn (char *dst, char *src, intp n, int swap, int itemsize)\n{\n\tint size = sizeof(Py_UNICODE);\n\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize * n);\n\t\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\tint j, i = size / 2;\n\t\tfor (a = (char *)dst; n>0; n--) {\n\t\t\tb = a + (size-1);\n                        for (j=0; j<i; j++) {\n                                c=*a; *a++ = *b; *b-- = c;\n                        }\n\t\t\ta += i / 2;\n\t\t}\n\t}\n}\n\n\nstatic void\nOBJECT_copyswap (PyObject **dst, PyObject **src, int swap, int itemsize)\n{\n        OBJECT_copyswapn(dst, src, 1, swap, itemsize);\n}\n\nstatic void\nSTRING_copyswap (char *dst, char *src, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize);\n\t\n}\n\n/* ignore swap */\nstatic void\nVOID_copyswap (char *dst, char *src, int swap, int itemsize)\n{\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize);\t\n\treturn;\n}\n\nstatic void\nUNICODE_copyswap (char *dst, char *src, int swap, int itemsize)\n{\n\tint size = sizeof(Py_UNICODE);\n\n\tif (src != NULL) \n\t\tmemcpy(dst, src, itemsize);\n\t\n\tif (swap) {\n\t\tregister char *a, *b, c;\n\t\tint j, i = size / 2;\n                a = (char *)dst;\n                b = a + (size-1);\n                for (j=0; j<i; j++) {\n                        c=*a; *a++ = *b; *b-- = c;\n                }\n\t}\n}\n\n\n/****************** nonzero **********************************/\n\n/**begin repeat\n#fname=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE#\n#type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble#\n*/\nstatic Bool \n@fname@_nonzero (@type@ *ip, PyArrayObject *ap)\n{\n\t@type@ t1;\n\tif (ap==NULL || PyArray_ISBEHAVED_RO(ap))\n\t\treturn (Bool) (*ip != 0);\n\telse {\n\t\t/* don't worry about swap, since we are just testing\n\t\t   whether or not equal to 0 */\n\t\tmemcpy(&t1, ip, sizeof(@type@));\n\t\treturn (Bool) (t1 != 0);\n\t}\n}\n/**end repeat**/\n\n#define WHITESPACE \" \\t\\n\\r\\v\\f\"\n#define WHITELEN 6\n\nstatic Bool\nPy_STRING_ISSPACE(char ch) \n{\n\tchar white[] = WHITESPACE;\n\tint j;\n\tBool space=FALSE;\n\tfor (j=0; j<WHITELEN; j++) {\t\n\t\tif (ch == white[j]) {\t\n\t\t\tspace=TRUE;\t\n\t\t\tbreak;\t\t\n\t\t}\t\t\t\n\t}\t\t\t\t\n\treturn space;\n}\n\nstatic Bool\nSTRING_nonzero (char *ip, PyArrayObject *ap)\n{\n\tint len = ap->itemsize;\n\tint i;\n\tBool nonz = FALSE;\n\n\tfor (i=0; i<len; i++) {\n\t\tif (!Py_STRING_ISSPACE(*ip)) {\n\t\t\tnonz = TRUE;\n\t\t\tbreak;\n\t\t}\n\t\tip++;\n\t}\n\treturn nonz;\n}\n\nstatic Bool\nUNICODE_nonzero (Py_UNICODE *ip, PyArrayObject *ap)\n{\n\tint len = ap->itemsize >> 1;\n\tint i;\n\tBool nonz = FALSE;\n\t\n\tfor (i=0; i<len; i++) {\n\t\tif (!Py_UNICODE_ISSPACE(*ip)) {\n\t\t\tnonz = TRUE;\n\t\t\tbreak;\n\t\t}\n\t\tip++;\n\t}\n\treturn nonz;\n}\n\nstatic Bool\nOBJECT_nonzero (PyObject **ip, PyArrayObject *ap)\n{\n\treturn (Bool) PyObject_IsTrue(*ip);\n}\n\n/* If subclass has _nonzero method call it with buffer\n   object wrapping current item.  Otherwise, just compare with '\\0'.\n*/\nstatic Bool\nVOID_nonzero (char *ip, PyArrayObject *ap)\n{\n\tint i;\n\tint len = ap->itemsize;\n\tBool nonz = FALSE;\n        PyObject *u=NULL;\n        int res;\n        PyObject *pyres=NULL;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj, \n\t\t\t\t\t      \"_nonzero\");\n        PyObject *args=NULL;\n\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n\t\t/* Default behavior */\n\t\tPy_XDECREF(meth);\n\t\tfor (i=0; i<len; i++) {\n\t\t\tif (*ip != '\\0') {\n\t\t\t\tnonz = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tip++;\n\t\t}\n\t\treturn nonz;\n        }\n\n        if (len < 0) return FALSE;\n\t\n        u = PyBuffer_FromMemory(ip, len);\n        if ((u==NULL)) {Py_DECREF(meth); return FALSE;}\n\n        args = Py_BuildValue(\"OO\",u, ap);\n        pyres = PyObject_CallObject(meth, args);\n\tPy_DECREF(args);\n\tPy_DECREF(u);\n\tPy_DECREF(meth);\n        if (pyres==NULL) return FALSE;\n        res = (int) PyInt_AsLong(pyres);\n\tPy_DECREF(pyres);\n        if (PyErr_Occurred()) return FALSE;\n\n\treturn (Bool) res;\n}\n\n\n/****************** compare **********************************/\n\n/**begin repeat\n#fname=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE#\n#type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n*/\n\nstatic int\n@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap) \n{\n        @type@ t1, t2;\n\n        if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {\n                return *ip1 < *ip2 ? -1 : *ip1 == *ip2 ? 0 : 1;\n        }\n        else { \n\t\tint size = ap->itemsize;\n\t\tBool swap = !PyArray_ISNOTSWAPPED(ap);\n\t\t/* copy to local, aligned variable */\n                copy_and_swap(&t1, ip1, size, 1, 0, swap);\n\t\tcopy_and_swap(&t2, ip2, size, 1, 0, swap);\n\t\treturn t1 < t2 ? -1 : t1 == t2 ? 0 : 1;\n        }\n}\n\n/**end repeat**/\n\n/* compare imaginary part first, then complex if equal imaginary  */\n/**begin repeat \n#fname=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#type= float, double, longdouble#\n*/\n\nstatic int\n@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap) \n{\n        @type@ t1, t2;\n\n        if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {\n\t\tif (*ip1 == *ip2) {\n\t\t\treturn ip1[1]<ip2[1] ? -1 : (ip1[1] == ip2[1] ? 0 : 1);\n\t\t}\n\t\telse {\n\t\t\treturn *ip1 < *ip2 ? -1 : 1;\n\t\t}\n        }\n        else { \n\t\tint size = ap->itemsize >> 1;\n\t\tBool swap = !PyArray_ISNOTSWAPPED(ap);\n\t\t/* copy to local, aligned variable */\n                copy_and_swap(&t1, ip1, size, 1, 0, swap);\n\t\tcopy_and_swap(&t2, ip2, size, 1, 0, swap);\n\t\tif (t1 == t2) {\n\t\t\tcopy_and_swap(&t1, ip1+1, size, 1, 0, swap);\n\t\t\tcopy_and_swap(&t2, ip2+1, size, 1, 0, swap);\n\t\t\treturn (t1 < t2 ? -1 : (t1 == t2 ? 0 : 1));\n\t\t}\n\t\telse {\n\t\t\treturn t1 < t2 ? -1 : 1;\n\t\t}\n        }\n}\n /**end repeat**/\n\nstatic int \nOBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *ap) \n{ \n\treturn PyObject_Compare(*ip1, *ip2);\n}\n\nstatic int \nSTRING_compare(char *ip1, char *ip2, PyArrayObject *ap)\n{\n\treturn strncmp(ip1, ip2, ap->itemsize);\n}\n\nstatic int \nUNICODE_compare(Py_UNICODE *ip1, Py_UNICODE *ip2, PyArrayObject *ap)\n{\n\tPyObject *u=NULL, *v=NULL;\n\tint res;\n        int itemsize=ap->itemsize;\n\tif (itemsize < 0) goto fail;\n\tu = PyUnicode_FromUnicode(ip1, itemsize);\n\tv = PyUnicode_FromUnicode(ip2, itemsize);\n\tif ((u==NULL) || (v==NULL)) goto fail;\n\tres = PyObject_Compare(u, v);\n\tPy_DECREF(u);\n\tPy_DECREF(v);\n\treturn res;\n       \n fail:\n\tPy_XDECREF(u);\n\tPy_XDECREF(v);\n\treturn 0;\n}\n\nstatic int\nVOID_compare(void *ip1, void *ip2, PyArrayObject *ap) \n{\n        PyObject *u=NULL, *v=NULL;\n        int res;\n        PyObject *pyres=NULL;\n        int itemsize=ap->itemsize;\n        PyObject *meth=PyObject_GetAttrString((PyObject *)ap->descr->typeobj,\n\t\t\t\t\t      \"_compare\");\n        PyObject *args=NULL;\n\n        if ((meth == NULL) || (!PyCallable_Check(meth))) {\n                PyErr_SetString(PyExc_NotImplementedError, \n\t\t\t\t\"Object needs a compare method.\");\n                goto fail;\n        }\n        if (itemsize < 0) goto fail;\n        u = PyBuffer_FromMemory(ip1, itemsize);\n        v = PyBuffer_FromMemory(ip2, itemsize);\n        if ((u==NULL) || (v==NULL)) goto fail;        \n        \n        args = Py_BuildValue(\"OOO\",u,v,ap);\n        \n        pyres = PyObject_CallObject(meth, args);\n        if (pyres==NULL) goto fail;\n        res = PyInt_AsLong(pyres);\n        if (PyErr_Occurred()) goto fail;        \n\n        Py_DECREF(meth);\n        Py_DECREF(args);\n        Py_DECREF(pyres);\n        Py_DECREF(u);\n        Py_DECREF(v);\n        return res;\n\n fail:\n        Py_XDECREF(pyres);\n        Py_XDECREF(meth);\n        Py_XDECREF(args);\n        Py_XDECREF(u);\n        Py_XDECREF(v);\n        return 0; \n}\n\n/****************** argfunc **********************************/\n\n/**begin repeat\n\n#fname= BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#\n#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble#\n#incr= ip++*14, ip+=2*3#\n*/\n\nstatic int\n@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip)\n{\n\tregister intp i;\n\t@type@ mp=*ip;\n\t*max_ind=0;\n\tfor (i=1; i<n; i++) {\n\t\t@incr@;\n\t\tif (*ip > mp) {\n\t\t\tmp = *ip;\n\t\t\t*max_ind = i;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**end repeat**/\n\nstatic int \nOBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *aip) \n{\n\tregister intp i; \n\tPyObject *mp=ip[0]; *max_ind=0;\n\tfor(i=1; i<n; i++) { \n\t\tip++;\n\t\tif (PyObject_Compare(*ip,mp) > 0) { \n\t\t\tmp = *ip; \n\t\t\t*max_ind=i;\n\t\t} \n\t} \n\treturn 0;\n}\n\n\n/**begin repeat\n\n#fname= STRING, UNICODE, VOID#\n#type= char, Py_UNICODE, void#\n\n*/\nstatic int \n@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) \n{\n\tregister intp i; \n\tint elsize = aip->itemsize;\n\t@type@ *mp = (@type@ *)malloc(elsize);\n\t\n\tif (mp==NULL) return 0;\n\tmemcpy(mp, ip, elsize);\n\t*max_ind = 0;\n\tfor(i=1; i<n; i++) { \n\t\tip += elsize;\n\t\tif (@fname@_compare(ip,mp,aip) > 0) { \n\t\t\tmemcpy(mp, ip, elsize);\n\t\t\t*max_ind=i;\n\t\t} \n\t} \n\treturn 0;\n}\n\n/**end repeat**/\n\n\n/**begin repeat\n\n#name=BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE#\n#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble#\n#out= Bool, intp, uintp, intp, uintp, intp, uintp, intp, uintp, longlong, ulonglong, float, double, longdouble#\n*/\n\nstatic void\n@name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, \n\t   void *ignore)\n{\n\t@out@ tmp=(@out@)0.0;\n\tint i;\n\tfor(i=0;i<n;i++,ip1+=is1,ip2+=is2) { \n\t\ttmp += (@out@)(*((@type@ *)ip1)) * \\\n\t\t\t(@out@)(*((@type@ *)ip2));\n\t}\t\t\t\t\t\t\t\n\t*((@out@ *)op) = tmp;\n}\n/**end repeat**/\n\n\n/**begin repeat\n\n#name=CFLOAT, CDOUBLE, CLONGDOUBLE#\n#type= float, double, longdouble#\n*/\n\nstatic void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,\n\t\t       char *op, intp n, void *ignore) \n{\t\t\t\t\n\t@type@ tmpr=(@type@)0.0, tmpi=(@type@)0.0; \n\tintp i;\t\n\tfor(i=0;i<n;i++,ip1+=is1,ip2+=is2) {\n\t\ttmpr += ((@type@ *)ip1)[0] * ((@type@ *)ip2)[0]\t\n\t\t\t- ((@type@ *)ip1)[1] * ((@type@ *)ip2)[1]; \n\t\ttmpi += ((@type@ *)ip1)[1] * ((@type@ *)ip2)[0] \n\t\t\t+ ((@type@ *)ip1)[0] * ((@type@ *)ip2)[1];\n\t}\t\t\t\t\t\t\t\n\t((@type@ *)op)[0] = tmpr; ((@type@ *)op)[1] = tmpi;\n}   \n\n/**end repeat**/\n\nstatic void \nOBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,\n\t   void *ignore) \n{\n\tintp i;\n\tPyObject *tmp1, *tmp2, *tmp=NULL;\n\tPyObject **tmp3;\n\tfor(i=0;i<n;i++,ip1+=is1,ip2+=is2) { \n\t\ttmp1 = PyNumber_Multiply(*((PyObject **)ip1), \n\t\t\t\t\t *((PyObject **)ip2));\n\t\tif (!tmp1) { Py_XDECREF(tmp); return;}\n\t\tif (i == 0) {\n\t\t\ttmp = tmp1;\n\t\t} else {\n\t\t\ttmp2 = PyNumber_Add(tmp, tmp1);\n\t\t\tPy_XDECREF(tmp);\n\t\t\tPy_XDECREF(tmp1);\n\t\t\tif (!tmp2) return;\n\t\t\ttmp = tmp2;\n\t\t}\n\t} \n\ttmp3 = (PyObject**) op;\n\ttmp2 = *tmp3;\n\t*((PyObject **)op) = tmp;\n\tPy_XDECREF(tmp2);\n}\n\n\n#define _ALIGN(type) offsetof(struct {char c; type v;},v)\n\n\n/**begin repeat\n\n#from= VOID, STRING, UNICODE#\n#align= char, char, Py_UNICODE#\n#NAME= Void, String, Unicode#\n*/\n\nstatic PyArray_Descr @from@_Descr = { \n                                      &Py@NAME@ArrType_Type,\n\t\t\t\t      PyArray_@from@LTR,\n\t\t\t\t      PyArray_@from@LTR,\n\t\t\t\t      PyArray_@from@, 0,\n\t\t\t\t      _ALIGN(@align@),\n{\n\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BOOL, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BYTE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UBYTE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_SHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_USHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_INT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UINT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONG,\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_FLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_DOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CFLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CLONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_OBJECT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_STRING, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UNICODE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_VOID\n\t},\n\t\t\t\t      (PyArray_GetItemFunc*)@from@_getitem, \n\t\t\t\t      (PyArray_SetItemFunc*)@from@_setitem,\n\t\t\t\t      (PyArray_CompareFunc*)@from@_compare, \n\t\t\t\t      (PyArray_ArgFunc*)@from@_argmax,\n\t\t\t\t      (PyArray_DotFunc*)NULL, \n\t\t\t\t      (PyArray_ScanFunc*)@from@_scan,\n\t\t\t\t      (PyArray_CopySwapNFunc*)@from@_copyswapn,\n                                      (PyArray_CopySwapFunc*)@from@_copyswap,\n\t\t\t\t      (PyArray_NonzeroFunc*)@from@_nonzero,\n};\n\n/**end repeat**/\n\n\n/**begin repeat\n\n#from= BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT#\n#num= 1*14,2*3,1#\n#fromtyp= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble, PyObject *#\n#NAME= Bool, Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, Object#\n#kind= GENBOOL, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, FLOATING, FLOATING, FLOATING, COMPLEX, COMPLEX, COMPLEX, OBJECT#\n*/\n\nstatic PyArray_Descr @from@_Descr = { \n\t\t\t\t      &Py@NAME@ArrType_Type,\n\t\t\t\t      PyArray_@kind@LTR,\n\t\t\t\t      PyArray_@from@LTR,\n\t\t\t\t      PyArray_@from@, \n\t\t\t\t      @num@*sizeof(@fromtyp@), \n\t\t\t\t      _ALIGN(@fromtyp@),\n{\n\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BOOL, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_BYTE,\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UBYTE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_SHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_USHORT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_INT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UINT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONG,\n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_ULONGLONG, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_FLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_DOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_LONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CFLOAT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_CLONGDOUBLE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_OBJECT, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_STRING, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_UNICODE, \n\t\t(PyArray_VectorUnaryFunc*)@from@_to_VOID\n\t},\n\t\t\t\t      (PyArray_GetItemFunc*)@from@_getitem, \n\t\t\t\t      (PyArray_SetItemFunc*)@from@_setitem,\n\t\t\t\t      (PyArray_CompareFunc*)@from@_compare, \n\t\t\t\t      (PyArray_ArgFunc*)@from@_argmax,\n\t\t\t\t      (PyArray_DotFunc*)@from@_dot, \n\t\t\t\t      (PyArray_ScanFunc*)@from@_scan,\n\t\t\t\t      (PyArray_CopySwapNFunc*)@from@_copyswapn,\n\t\t\t\t      (PyArray_CopySwapFunc*)@from@_copyswap,\n\t\t\t\t      (PyArray_NonzeroFunc*)@from@_nonzero,\n};\n\n/**end repeat**/\n\nstatic PyArray_Descr *descrs[] = {\n\t&BOOL_Descr,\n\t&BYTE_Descr,\n\t&UBYTE_Descr,\n\t&SHORT_Descr, \n\t&USHORT_Descr, \n\t&INT_Descr, \n\t&UINT_Descr, \n\t&LONG_Descr, \n\t&ULONG_Descr,\n\t&LONGLONG_Descr,\n\t&ULONGLONG_Descr,\n\t&FLOAT_Descr, \n\t&DOUBLE_Descr,\n\t&LONGDOUBLE_Descr,\n\t&CFLOAT_Descr, \n\t&CDOUBLE_Descr, \n\t&CLONGDOUBLE_Descr,\n\t&OBJECT_Descr, \n\t&STRING_Descr, \n\t&UNICODE_Descr,\n\t&VOID_Descr,\n};\n\nstatic PyArray_Descr **userdescrs=NULL;\n\nstatic PyArray_Descr *\nPyArray_DescrFromType(int type) {\n\tif (type < PyArray_NTYPES) {\n\t\treturn descrs[type];\n\t}\n\telse if (type == PyArray_NOTYPE) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Invalid type for array\"); \n\t\treturn NULL;\n\t}\n\telse if PyTypeNum_ISUSERDEF(type) {\n\t\treturn userdescrs[type-PyArray_USERDEF];\n\t} \n\telse {\n\t\tswitch(type) {\n                case PyArray_INTPLTR: return descrs[PyArray_INTP];\n\t\tcase PyArray_DOUBLELTR: return descrs[PyArray_DOUBLE];\n\t\tcase PyArray_CDOUBLELTR: return descrs[PyArray_CDOUBLE];\n\n                case PyArray_UINTPLTR: return descrs[PyArray_UINTP];\n                case PyArray_BOOLLTR: return descrs[PyArray_BOOL];\n\t\tcase PyArray_BYTELTR: return descrs[PyArray_BYTE];\n\t\tcase PyArray_UBYTELTR: return descrs[PyArray_UBYTE];\n\t\tcase PyArray_SHORTLTR: return descrs[PyArray_SHORT];\n\t\tcase PyArray_USHORTLTR: return descrs[PyArray_USHORT];\n\t\tcase PyArray_INTLTR: return descrs[PyArray_INT];\n\t\tcase PyArray_UINTLTR: return descrs[PyArray_UINT];\n\t\tcase PyArray_LONGLTR: return descrs[PyArray_LONG];\n                case PyArray_ULONGLTR: return descrs[PyArray_ULONG];\n                case PyArray_LONGLONGLTR: return descrs[PyArray_LONGLONG];\n                case PyArray_ULONGLONGLTR: return descrs[PyArray_ULONGLONG];\n\t\tcase PyArray_FLOATLTR: return descrs[PyArray_FLOAT];\n                case PyArray_LONGDOUBLELTR: return descrs[PyArray_LONGDOUBLE];\n\t\tcase PyArray_CFLOATLTR: return descrs[PyArray_CFLOAT];\n                case PyArray_CLONGDOUBLELTR: \n\t\t\treturn descrs[PyArray_CLONGDOUBLE];\n\t\tcase PyArray_OBJECTLTR: return descrs[PyArray_OBJECT];\n\t\tcase PyArray_STRINGLTR: return descrs[PyArray_STRING];\n                case PyArray_UNICODELTR: return descrs[PyArray_UNICODE];\n\t        case PyArray_VOIDLTR: return descrs[PyArray_VOID];\n\t\tdefault:\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"Invalid type for array\");\t\n\t\t\treturn NULL;\n\t\t}\n\t}\n}\n\n\n\nstatic int\nset_typeinfo(PyObject *dict)\n{\n\tPyObject *infodict, *s;\n\n\t/* Set a dictionary with type information */\n\tinfodict = PyDict_New();\n\tif (infodict == NULL) return -1;\n\n#define BITSOF_INTP CHAR_BIT*SIZEOF_PY_INTPTR_T\n#define BITSOF_BYTE CHAR_BIT\n\n/**begin repeat \n\n#name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,INTP,UINTP,LONG,ULONG,LONGLONG,ULONGLONG#\n#uname=BOOL,BYTE*2,SHORT*2,INT*2,INTP*2,LONG*2,LONGLONG*2#\n#Name=Bool,Byte,UByte,Short,UShort,Int,UInt,Intp,UIntp,Long,ULong,LongLong,ULongLong#\n#type=Bool,byte,ubyte,short,ushort,int,uint,intp,uintp,long,ulong,longlong,ulonglong#\n#max=1,MAX_BYTE,MAX_UBYTE,MAX_SHORT,MAX_USHORT,MAX_INT,PyLong_FromUnsignedLong(MAX_UINT),PyLong_FromLongLong((longlong) MAX_INTP),PyLong_FromUnsignedLongLong((ulonglong) MAX_UINTP),MAX_LONG,PyLong_FromUnsignedLong((unsigned long) MAX_ULONG),PyLong_FromLongLong((longlong) MAX_LONGLONG), PyLong_FromUnsignedLongLong((ulonglong) MAX_ULONGLONG)#\n#min=0,MIN_BYTE,0,MIN_SHORT,0,MIN_INT,0,PyLong_FromLongLong((longlong) MIN_INTP),0,MIN_LONG,0,PyLong_FromLongLong((longlong) MIN_LONGLONG),0#\n#cx=i*6,N,N,N,l,N,N,N#\n#cn=i*7,N,i,l,i,N,i#\n*/\n       \tPyDict_SetItemString(infodict, \"@name@\", \n\t\t\t     s=Py_BuildValue(\"ciii@cx@@cn@O\", \n\t\t\t\t\t     PyArray_@name@LTR, \n\t\t\t\t\t     PyArray_@name@,\n\t\t\t\t\t     BITSOF_@uname@,\n\t\t\t\t\t     _ALIGN(@type@),\n\t\t\t\t\t     @max@, @min@,\n\t\t\t\t     (PyObject *)&Py@Name@ArrType_Type));\n\tPy_DECREF(s); \n/**end repeat**/\n\n#define BITSOF_CFLOAT 2*BITSOF_FLOAT\n#define BITSOF_CDOUBLE 2*BITSOF_DOUBLE\n#define BITSOF_CLONGDOUBLE 2*BITSOF_LONGDOUBLE\n\n/**begin repeat\n\n#type=float,double,longdouble,cfloat,cdouble,clongdouble#\n#name=FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#\n#Name=Float,Double,LongDouble,CFloat,CDouble,CLongDouble#\n*/\n \tPyDict_SetItemString(infodict, \"@name@\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_@name@LTR, \n\t\t\t\t\t     PyArray_@name@, BITSOF_@name@,\n\t\t\t\t\t     _ALIGN(@type@),\n                                             (PyObject *)\\\n                                             &Py@Name@ArrType_Type));\n\tPy_DECREF(s);\n/**end repeat**/\n\t\n\tPyDict_SetItemString(infodict, \"OBJECT\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_OBJECTLTR, \n\t\t\t\t\t     PyArray_OBJECT, \n\t\t\t\t\t     sizeof(PyObject *)*CHAR_BIT,\n\t\t\t\t\t     _ALIGN(PyObject *),\n                                             (PyObject *)\\\n                                             &PyObjectArrType_Type));\n\tPy_DECREF(s);\n\tPyDict_SetItemString(infodict, \"STRING\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_STRINGLTR, \n\t\t\t\t\t     PyArray_STRING, 0,\n\t\t\t\t\t     _ALIGN(char),\n                                             (PyObject *)\\\n                                             &PyStringArrType_Type));\n\tPy_DECREF(s);\n\tPyDict_SetItemString(infodict, \"UNICODE\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_UNICODELTR, \n\t\t\t\t\t     PyArray_UNICODE, 0,\n\t\t\t\t\t     _ALIGN(Py_UNICODE),\n                                             (PyObject *)\\\n                                             &PyUnicodeArrType_Type));\t\n\tPy_DECREF(s);\n\tPyDict_SetItemString(infodict, \"VOID\", \n\t\t\t     s=Py_BuildValue(\"ciiiO\", PyArray_VOIDLTR, \n\t\t\t\t\t     PyArray_VOID, 0,\n\t\t\t\t\t     _ALIGN(char),\n                                             (PyObject *)\\\n                                             &PyVoidArrType_Type));\t\n\tPy_DECREF(s);\n\n#define SETTYPE(name)                           \\\n        Py_INCREF(&Py##name##ArrType_Type);     \\\n        PyDict_SetItemString(infodict, #name,   \\\n                             (PyObject *)&Py##name##ArrType_Type);\n\n        SETTYPE(Generic)\n        SETTYPE(Numeric)\n        SETTYPE(Integer)\n\tSETTYPE(Inexact)\n        SETTYPE(SignedInteger)\n        SETTYPE(UnsignedInteger)\n        SETTYPE(Floating)\n        SETTYPE(ComplexFloating)\n        SETTYPE(Flexible)\n        SETTYPE(Character)\n\n#undef SETTYPE       \t\n\n\tPyDict_SetItemString(dict, \"typeinfo\", infodict);\n\tPy_DECREF(infodict);\n\treturn 0;\n}\n\n\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [
                        "#format=\"hd\",\"hu\",\"d\",\"u\",\"ld\",\"lu\",LONGLONG_FMT,ULONGLONG_FMT,\"f\",\"lf\",\"Lf\"#",
                        "\tnum = fscanf(fp, \"%\"@format@, ip);"
                    ],
                    "deleted": [
                        "#format=\"%hd\",\"%hu\",\"%d\",\"%u\",\"%ld\",\"%lu\",LONGLONG_FMT,ULONGLONG_FMT,\"%f\",\"%lf\",\"%Lf\"#",
                        "\tnum = fscanf(fp, @format@, ip);"
                    ]
                }
            },
            {
                "old_path": "scipy/doc/CAPI.txt",
                "new_path": "scipy/doc/CAPI.txt",
                "filename": "CAPI.txt",
                "extension": "txt",
                "change_type": "MODIFY",
                "diff": "@@ -164,6 +164,7 @@ requires can be any of\n   NOTSWAPPED, \n   WRITEABLE, \n   ENSURECOPY, \n+  ENSUREARRAY,\n   UPDATEIFCOPY,\n   FORCECAST,\n \n@@ -182,8 +183,11 @@ requires can be any of\n    CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n    FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n    \n-   By default, if the object is an array and requires is 0, \n+   By default, if the object is an array (or any subclass) and requires is 0, \n    the array will just be INCREF'd and returned. \n+\n+   ENSUREARRAY makes sure a base-class ndarray is returned (If the object is a \n+   bigndarray it will also be returned).   \n    \n    typecode->fortran can be set to request a\n    fortran-contiguous  array (or just | FORTRAN to the requires flags).\n",
                "added_lines": 5,
                "deleted_lines": 1,
                "source_code": "Author:          Travis Oliphant\nDiscussions to:  scipy-dev@scipy.org\nCreated:         October 2005\n\nThe CAPI of SciPy is (mostly) backward compatible with Numeric.  \n\nThere are a few non-standard Numeric usages (that were not really part\nof the API) that will need to be changed:\n\n  * If you used any of the function pointers in the PyArray_Descr\n    structure you will have to modify your usage of those.  The\n    casting functions have eliminated the strides argument (use\n    PyArray_CastTo if you need strided casting). All functions have\n    one or two PyArrayObject * arguments at the end.  This allows the\n    flexible arrays and mis-behaved arrays to be handled.\n\n  * The descr->zero and descr->one constants have been replaced with\n    function calls, PyArray_Zero, and PyArray_One.\n\n  * You should use PyArray_ITEMSIZE(obj) instead of descr->elsize to\n    get the itemsize of an object (for flexible arrays descr->elsize\n    is 0).\n\n  * If you passed array->dimensions and array->strides around to \n    functions.  These are now, intp* pointers.  On 32-bit systems\n    there won't be a problem.  However, on 64-bit systems, you will\n    need to make changes.  \n\n\nThe header files arrayobject.h and ufuncobject.h contain many defines\nthat you may find useful.  The files __ufunc_api.h and\n__multiarray_api.h contain the available C-API function calls with\ntheir function signatures.\n\nAll of these headers are installed to \n\n<YOUR_PYTHON_LOCATION>/site-packages/scipy/base/include\n\n\nGetting arrays in C-code\n=========================\n\nAll new arrays can be created using PyArray_New.  A simple interface \nequivalent to PyArray_FromDims is PyArray_SimpleNew(nd, dims, typenum)\n\nThis is a very flexible function.  \n\nPyObject * PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type, \n         intp *strides, char *data, int itemsize, int flags, \n         PyObject *obj);\n\n\nsubtype  : The subtype that should be created (either pass in\n             &PyArray_Type, &PyBigArray_Type, or obj->ob_type,\n             where obj is a subtype (or subclass) of \n\t     of PyArray_Type or PyBigArray_Type).\n\nnd       : The number of dimensions (<MAX_DIMS)\n\n*dims    : A pointer to the size in each dimension.  Information will be\n             copied from here.\n\ntype     : An integer specifying the type of the array \n             (use the PyArray_XXXX enumerated types).\n\n*strides : The strides this array should have.  For new arrays created\n             by this routine, this should be NULL.  If you pass in\n             memory for this array to use, then you should pass in the\n             strides information as well.  Any strides will be copied into\n\t     the array structure.   Do not pass in bad strides information.\n\n\t    PyArray_CheckStrides(...) can help but you must call it if you are\n\t     unsure.\n\n*data    : NULL for creating brand-new memory.  If you want this array\n             to wrap another memory area, then pass the pointer here.\n             You are responsible for deleting the memory in that case,\n             but do not do so until the new array object has been\n             deleted.  The best way to handle that is to get the memory\n             from another Python object, INCREF that Python object after\n             passing it's data pointer to this routine, and set the\n             ->base member of the returned array to the Python object.\n             You are responsible for setting the base object.  Failure\n             to do so will create a memory leak.  \n            \n            If you pass in a data buffer, the flags argument will be\n              the flags of the new array. If you create a new array, a\n              non-zero flags argument indicates that you want the array\n              to be in FORTRAN order.\n\nitemsize : Indicates the itemsize for the new array.  This can be 0\n             if it is a fixed-size array type.  It is only used for\n             flexible array types and must be set in that case.\n\n\nflags    : Either the flags showing how to interpret the data buffer\n             passed in.  Or if a new array is created, nonzero to\n             indicate a FORTRAN order array.  See below for an explanation of\n\t     the flags.\n\n\nobj      : If subtypes is &PyArray_Type or &PyBigArray_Type, this\n             argument is ignored.  Otherwise, the __array_finalize__\n             method of the subtype is called (if present) and passed\n             this object.  This is usually an array of the type to be\n             created (so the __array_finalize__ method must handle an\n             array argument.  But, it can be anything...)\n\nNote: The returned array object will be unitialized unless the type is\nPyArray_OBJECT.\n\nPyArray_SimpleNew(nd, dims, typenum)  is a drop-in replacement for \nPyArray_FromDims (except it takes intp* dims instead of int* dims which\n\t\t  matters on 64-bit systems).\n\nPyArray_SimpleNew is just a macro for PyArray_New with default arguments.\n\n\nThe PyArray_FromDims and family of functions are still available and\nare loose wrappers around this function.  These functions still take\nint * arguments.  This should be fine on 32-bit systems, but on 64-bit\nsystems you may run into trouble if you frequently passed \nPyArray_FromDims the dimensions member of the old PyArrayObject structure\nbecause sizeof(intp) != sizeof(int).\n\n\nGetting an arrayobject from an arbitrary Python object\n==============================================================\n\nPyArray_FromAny(...)\n\nThis function replaces PyArray_ContiguousFromObject and friends (those\nfunction calls still remain but they are loose wrappers around the\nPyArray_FromAny call).\n\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n\n\nop        : The Python object to \"convert\" to an array object\n\ntypecode  : A typecode structure filled with the data type and\n              itemsize of the desired data type.  This can be NULL, if\n              the type should be determined from the object.  Unless\n              FORCECAST is present in flags, this call will generate\n              an error if the data type cannot be safely obtained from\n              the object.\n\nmin_depth : The minimum depth of array needed or 0 if doesn't matter\n\nmax_depth : The maximum depth of array allowed or 0 if doesn't matter\n\nrequires  : A flag indicating the \"requirements\" of the returned array. \n\n\nFrom the code comments, the requires flag is explained.\n\nrequires can be any of \n\n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  ENSUREARRAY,\n  UPDATEIFCOPY,\n  FORCECAST,\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 to guarantee CONTIGUOUS, ALIGNED, NOTSWAPPED, \n   and WRITEABLE and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, if the object is an array (or any subclass) and requires is 0, \n   the array will just be INCREF'd and returned. \n\n   ENSUREARRAY makes sure a base-class ndarray is returned (If the object is a \n   bigndarray it will also be returned).   \n   \n   typecode->fortran can be set to request a\n   fortran-contiguous  array (or just | FORTRAN to the requires flags).\n   Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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.  This is useful, \n   if you don't want to deal with a possibly mis-behaved array, but want\n   to update it easily using a local contiguous copy. \n\n   FORCECAST will cause a cast to occur regardless of whether or not\n   it is safe. \n\n\nPyArray_Typecode structure\n{\n        int type_num;\n        int itemsize;\n        int fortran --- used to indicate a fortran array is desired.\n}\n\n\nPyArray_ContiguousFromAny(op, typenum, min_depth, max_depth) is equivalent\nto PyArray_ContiguousFromObject(...) (which is still available), except\nit will return the subclass if op is already a subclass of the ndarray.  \nThe ContiguousFromObject version will always return an ndarray (or a bigndarray). \n\nPassing Data Type information to C-code\n============================================\n\nTo get a Typecode structure from Python use the\nPyArray_TypecodeConverter function.  This will return a typecode\nstructure filled appropriately based on a wide variety of user inputs.\n\nSee the arraymethods.c and multiarraymodule.c files for many examples of usage.\n\n\nGetting at the structure of the array.\n\nYou should use the #defines provided to access array structure portions:\n\nPyArray_DATA(obj)\nPyArray_ITEMSIZE(obj)\nPyArray_NDIM(obj)\nPyArray_DIMS(obj)\nPyArray_DIM(obj, n)\nPyArray_STRIDES(obj)\nPyArray_STRIDE(obj,n)\n\n\nsee more in arrayobject.h\n\n\n\nNDArray Flags\n==========================\n\nThe flags attribute of the PyArrayObject structure contains important \ninformation about the memory used by the array (pointed to by the data member)\nThis flags information must be kept accurate or strange results and even\nsegfaults may result. \n\nThere are 7 (binary) flags that describe the memory area used by the\ndata buffer.  These constants are defined in arrayobject.h and\ndetermine the bit-position of the flag.  Python exposes a nice dictionary\ninterface for getting (and sometimes setting) these flags.\n\nMemory areas of all kinds can be pointed to by an NDArray, necessitating \nthese flags.  If you get a PyArrayObject in C-code, \nyou should be aware of the flags that are set.  \nIf you need to guarantee a certain kind of array \n(like CONTIGUOUS and BEHAVED), then pass these requirements into the \nPyArray_FromAny function.  \n\n\nCONTIGUOUS  :  True if the array is a (C-style) contiguous in memory.\nFORTRAN     :  True if the array is (Fortran-style) contiguous in memory.\n\nNotice that 1-d arrays are always both FORTRAN contiguous and C contiguous.\nBoth of these flags can be checked and are convenience flags.\n\nOWNDATA     :  True if the array owns the memory (it will try and free it\n\t        using PyDataMem_FREE() on deallocation --- \n\t\tso it better really own it).\n\nThese three flags facilitate using a data pointer that is a memory-mapped\narray, or part of some larger record array.  But, they may have other uses...\n\nALIGNED     :  True if the data buffer is aligned for the type.  This\n\t        can be checked.\nNOTSWAPPED  :  True if the data is in machine byte order.  Arrays\n\t        can be out of machine byte order and will still \n\t\twork (albeit more slowly).  \nWRITEABLE   :  True only if the data buffer can be \"written\" to.\n\n\nUPDATEIFCOPY :  This is a special flag that is set if this array represents\n\t          a copy made because a user required certain FLAGS in \n\t\t  PyArray_FromAny  and a copy had to be made of some \n\t\t  other array.   The base attribute then points to the \n\t\t  \"misbehaved\" array.  When the array with this flag\n                  set is deallocated, it will copy its contents to\n\t          the \"misbehaved\" array (casting if necessary).\n\n\nPyArray_UpdateFlags(obj, FLAGS) will update the obj->flags for FLAGS\n                  which can be any of CONTIGUOUS FORTRAN or ALIGNED.\n\nSome useful combinations of these flags:\n\nBEHAVED = ALIGNED | NOTSWAPPED | WRITEABLE\nBEHAVED_RO = ALIGNED | NOTSWAPPED\nCARRAY_FLAGS = CONTIGUOUS | BEHAVED\nFARRAY_FLAGS = FORTRAN | BEHAVED\n\n\nThe macro PyArray_CHECKFLAGS(obj, FLAGS)  can test any combination of flags.\nThere are several default combinations defined as macros already \n(see arrayobject.h) \n\n\n\n\n\nThere are more C-API enhancements which you can discover in the code, \n      or buy the book (http://www.trelgol.com)\n\n\n",
                "source_code_before": "Author:          Travis Oliphant\nDiscussions to:  scipy-dev@scipy.org\nCreated:         October 2005\n\nThe CAPI of SciPy is (mostly) backward compatible with Numeric.  \n\nThere are a few non-standard Numeric usages (that were not really part\nof the API) that will need to be changed:\n\n  * If you used any of the function pointers in the PyArray_Descr\n    structure you will have to modify your usage of those.  The\n    casting functions have eliminated the strides argument (use\n    PyArray_CastTo if you need strided casting). All functions have\n    one or two PyArrayObject * arguments at the end.  This allows the\n    flexible arrays and mis-behaved arrays to be handled.\n\n  * The descr->zero and descr->one constants have been replaced with\n    function calls, PyArray_Zero, and PyArray_One.\n\n  * You should use PyArray_ITEMSIZE(obj) instead of descr->elsize to\n    get the itemsize of an object (for flexible arrays descr->elsize\n    is 0).\n\n  * If you passed array->dimensions and array->strides around to \n    functions.  These are now, intp* pointers.  On 32-bit systems\n    there won't be a problem.  However, on 64-bit systems, you will\n    need to make changes.  \n\n\nThe header files arrayobject.h and ufuncobject.h contain many defines\nthat you may find useful.  The files __ufunc_api.h and\n__multiarray_api.h contain the available C-API function calls with\ntheir function signatures.\n\nAll of these headers are installed to \n\n<YOUR_PYTHON_LOCATION>/site-packages/scipy/base/include\n\n\nGetting arrays in C-code\n=========================\n\nAll new arrays can be created using PyArray_New.  A simple interface \nequivalent to PyArray_FromDims is PyArray_SimpleNew(nd, dims, typenum)\n\nThis is a very flexible function.  \n\nPyObject * PyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type, \n         intp *strides, char *data, int itemsize, int flags, \n         PyObject *obj);\n\n\nsubtype  : The subtype that should be created (either pass in\n             &PyArray_Type, &PyBigArray_Type, or obj->ob_type,\n             where obj is a subtype (or subclass) of \n\t     of PyArray_Type or PyBigArray_Type).\n\nnd       : The number of dimensions (<MAX_DIMS)\n\n*dims    : A pointer to the size in each dimension.  Information will be\n             copied from here.\n\ntype     : An integer specifying the type of the array \n             (use the PyArray_XXXX enumerated types).\n\n*strides : The strides this array should have.  For new arrays created\n             by this routine, this should be NULL.  If you pass in\n             memory for this array to use, then you should pass in the\n             strides information as well.  Any strides will be copied into\n\t     the array structure.   Do not pass in bad strides information.\n\n\t    PyArray_CheckStrides(...) can help but you must call it if you are\n\t     unsure.\n\n*data    : NULL for creating brand-new memory.  If you want this array\n             to wrap another memory area, then pass the pointer here.\n             You are responsible for deleting the memory in that case,\n             but do not do so until the new array object has been\n             deleted.  The best way to handle that is to get the memory\n             from another Python object, INCREF that Python object after\n             passing it's data pointer to this routine, and set the\n             ->base member of the returned array to the Python object.\n             You are responsible for setting the base object.  Failure\n             to do so will create a memory leak.  \n            \n            If you pass in a data buffer, the flags argument will be\n              the flags of the new array. If you create a new array, a\n              non-zero flags argument indicates that you want the array\n              to be in FORTRAN order.\n\nitemsize : Indicates the itemsize for the new array.  This can be 0\n             if it is a fixed-size array type.  It is only used for\n             flexible array types and must be set in that case.\n\n\nflags    : Either the flags showing how to interpret the data buffer\n             passed in.  Or if a new array is created, nonzero to\n             indicate a FORTRAN order array.  See below for an explanation of\n\t     the flags.\n\n\nobj      : If subtypes is &PyArray_Type or &PyBigArray_Type, this\n             argument is ignored.  Otherwise, the __array_finalize__\n             method of the subtype is called (if present) and passed\n             this object.  This is usually an array of the type to be\n             created (so the __array_finalize__ method must handle an\n             array argument.  But, it can be anything...)\n\nNote: The returned array object will be unitialized unless the type is\nPyArray_OBJECT.\n\nPyArray_SimpleNew(nd, dims, typenum)  is a drop-in replacement for \nPyArray_FromDims (except it takes intp* dims instead of int* dims which\n\t\t  matters on 64-bit systems).\n\nPyArray_SimpleNew is just a macro for PyArray_New with default arguments.\n\n\nThe PyArray_FromDims and family of functions are still available and\nare loose wrappers around this function.  These functions still take\nint * arguments.  This should be fine on 32-bit systems, but on 64-bit\nsystems you may run into trouble if you frequently passed \nPyArray_FromDims the dimensions member of the old PyArrayObject structure\nbecause sizeof(intp) != sizeof(int).\n\n\nGetting an arrayobject from an arbitrary Python object\n==============================================================\n\nPyArray_FromAny(...)\n\nThis function replaces PyArray_ContiguousFromObject and friends (those\nfunction calls still remain but they are loose wrappers around the\nPyArray_FromAny call).\n\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Typecode *typecode, int min_depth, \n\t\tint max_depth, int requires) \n\n\nop        : The Python object to \"convert\" to an array object\n\ntypecode  : A typecode structure filled with the data type and\n              itemsize of the desired data type.  This can be NULL, if\n              the type should be determined from the object.  Unless\n              FORCECAST is present in flags, this call will generate\n              an error if the data type cannot be safely obtained from\n              the object.\n\nmin_depth : The minimum depth of array needed or 0 if doesn't matter\n\nmax_depth : The maximum depth of array allowed or 0 if doesn't matter\n\nrequires  : A flag indicating the \"requirements\" of the returned array. \n\n\nFrom the code comments, the requires flag is explained.\n\nrequires can be any of \n\n  CONTIGUOUS, \n  FORTRAN, (or set typecode->fortran=1)\n  ALIGNED, \n  NOTSWAPPED, \n  WRITEABLE, \n  ENSURECOPY, \n  UPDATEIFCOPY,\n  FORCECAST,\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 to guarantee CONTIGUOUS, ALIGNED, NOTSWAPPED, \n   and WRITEABLE and therefore it is redundant to include those as well. \n\n   BEHAVED_FLAGS == ALIGNED | NOTSWAPPED | WRITEABLE\n   BEHAVED_FLAGS_RO == ALIGNED | NOTSWAPPED\n   CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n   FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n   \n   By default, if the object is an array and requires is 0, \n   the array will just be INCREF'd and returned. \n   \n   typecode->fortran can be set to request a\n   fortran-contiguous  array (or just | FORTRAN to the requires flags).\n   Fortran arrays are always behaved (aligned, \n   notswapped, and writeable) and not (C) CONTIGUOUS.  Note that either\n   FORTRAN in the flag or typecode->fortran = 1 is enough to request\n   a FORTRAN-style array. \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.  This is useful, \n   if you don't want to deal with a possibly mis-behaved array, but want\n   to update it easily using a local contiguous copy. \n\n   FORCECAST will cause a cast to occur regardless of whether or not\n   it is safe. \n\n\nPyArray_Typecode structure\n{\n        int type_num;\n        int itemsize;\n        int fortran --- used to indicate a fortran array is desired.\n}\n\n\nPyArray_ContiguousFromAny(op, typenum, min_depth, max_depth) is equivalent\nto PyArray_ContiguousFromObject(...) (which is still available), except\nit will return the subclass if op is already a subclass of the ndarray.  \nThe ContiguousFromObject version will always return an ndarray (or a bigndarray). \n\nPassing Data Type information to C-code\n============================================\n\nTo get a Typecode structure from Python use the\nPyArray_TypecodeConverter function.  This will return a typecode\nstructure filled appropriately based on a wide variety of user inputs.\n\nSee the arraymethods.c and multiarraymodule.c files for many examples of usage.\n\n\nGetting at the structure of the array.\n\nYou should use the #defines provided to access array structure portions:\n\nPyArray_DATA(obj)\nPyArray_ITEMSIZE(obj)\nPyArray_NDIM(obj)\nPyArray_DIMS(obj)\nPyArray_DIM(obj, n)\nPyArray_STRIDES(obj)\nPyArray_STRIDE(obj,n)\n\n\nsee more in arrayobject.h\n\n\n\nNDArray Flags\n==========================\n\nThe flags attribute of the PyArrayObject structure contains important \ninformation about the memory used by the array (pointed to by the data member)\nThis flags information must be kept accurate or strange results and even\nsegfaults may result. \n\nThere are 7 (binary) flags that describe the memory area used by the\ndata buffer.  These constants are defined in arrayobject.h and\ndetermine the bit-position of the flag.  Python exposes a nice dictionary\ninterface for getting (and sometimes setting) these flags.\n\nMemory areas of all kinds can be pointed to by an NDArray, necessitating \nthese flags.  If you get a PyArrayObject in C-code, \nyou should be aware of the flags that are set.  \nIf you need to guarantee a certain kind of array \n(like CONTIGUOUS and BEHAVED), then pass these requirements into the \nPyArray_FromAny function.  \n\n\nCONTIGUOUS  :  True if the array is a (C-style) contiguous in memory.\nFORTRAN     :  True if the array is (Fortran-style) contiguous in memory.\n\nNotice that 1-d arrays are always both FORTRAN contiguous and C contiguous.\nBoth of these flags can be checked and are convenience flags.\n\nOWNDATA     :  True if the array owns the memory (it will try and free it\n\t        using PyDataMem_FREE() on deallocation --- \n\t\tso it better really own it).\n\nThese three flags facilitate using a data pointer that is a memory-mapped\narray, or part of some larger record array.  But, they may have other uses...\n\nALIGNED     :  True if the data buffer is aligned for the type.  This\n\t        can be checked.\nNOTSWAPPED  :  True if the data is in machine byte order.  Arrays\n\t        can be out of machine byte order and will still \n\t\twork (albeit more slowly).  \nWRITEABLE   :  True only if the data buffer can be \"written\" to.\n\n\nUPDATEIFCOPY :  This is a special flag that is set if this array represents\n\t          a copy made because a user required certain FLAGS in \n\t\t  PyArray_FromAny  and a copy had to be made of some \n\t\t  other array.   The base attribute then points to the \n\t\t  \"misbehaved\" array.  When the array with this flag\n                  set is deallocated, it will copy its contents to\n\t          the \"misbehaved\" array (casting if necessary).\n\n\nPyArray_UpdateFlags(obj, FLAGS) will update the obj->flags for FLAGS\n                  which can be any of CONTIGUOUS FORTRAN or ALIGNED.\n\nSome useful combinations of these flags:\n\nBEHAVED = ALIGNED | NOTSWAPPED | WRITEABLE\nBEHAVED_RO = ALIGNED | NOTSWAPPED\nCARRAY_FLAGS = CONTIGUOUS | BEHAVED\nFARRAY_FLAGS = FORTRAN | BEHAVED\n\n\nThe macro PyArray_CHECKFLAGS(obj, FLAGS)  can test any combination of flags.\nThere are several default combinations defined as macros already \n(see arrayobject.h) \n\n\n\n\n\nThere are more C-API enhancements which you can discover in the code, \n      or buy the book (http://www.trelgol.com)\n\n\n",
                "methods": [],
                "methods_before": [],
                "changed_methods": [],
                "nloc": null,
                "complexity": null,
                "token_count": null,
                "diff_parsed": {
                    "added": [
                        "  ENSUREARRAY,",
                        "   By default, if the object is an array (or any subclass) and requires is 0,",
                        "",
                        "   ENSUREARRAY makes sure a base-class ndarray is returned (If the object is a",
                        "   bigndarray it will also be returned)."
                    ],
                    "deleted": [
                        "   By default, if the object is an array and requires is 0,"
                    ]
                }
            }
        ]
    },
    {
        "hash": "6e62330243f7e5a1e6b21b144a11903b0bd7d79a",
        "msg": "r391@Blasphemy:  kern | 2005-10-14 19:54:35 -0700\n Fix RandomState.random_integers()",
        "author": {
            "name": "Robert Kern",
            "email": "robert.kern@gmail.com"
        },
        "committer": {
            "name": "Robert Kern",
            "email": "robert.kern@gmail.com"
        },
        "author_date": "2005-10-15T02:55:20+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-15T02:55:20+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "9ef026af05ce30c7329a021bc56a81af228588ff"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/repo_copy",
        "deletions": 396,
        "insertions": 396,
        "lines": 792,
        "files": 2,
        "dmm_unit_size": null,
        "dmm_unit_complexity": null,
        "dmm_unit_interfacing": null,
        "modified_files": [
            {
                "old_path": "scipy/corelib/mtrand/mtrand.c",
                "new_path": "scipy/corelib/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 Fri Oct 14 17:30:55 2005 */\n+/* Generated by Pyrex 0.9.3.2a on Fri Oct 14 19:51:22 2005 */\n \n #include \"Python.h\"\n #include \"structmember.h\"\n@@ -179,11 +179,11 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":124 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":125 */\n     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -192,7 +192,7 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":127 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -212,20 +212,20 @@ static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":128 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":129 */\n     __pyx_v_array_data = ((double (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":130 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":131 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n     }\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":132 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -259,11 +259,11 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":140 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":141 */\n     __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -272,7 +272,7 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":143 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -292,20 +292,20 @@ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":144 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":145 */\n     __pyx_v_array_data = ((double (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":146 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":147 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n     }\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":148 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -339,11 +339,11 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":157 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -352,7 +352,7 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":160 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -372,20 +372,20 @@ static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":161 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":162 */\n     __pyx_v_array_data = ((double (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":163 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":164 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n     }\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":165 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -419,11 +419,11 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":175 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -432,7 +432,7 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":178 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -452,20 +452,20 @@ static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":179 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":180 */\n     __pyx_v_array_data = ((double (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":181 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":183 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -501,11 +501,11 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":191 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":192 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -514,7 +514,7 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":194 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -534,20 +534,20 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*_\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":195 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":196 */\n     __pyx_v_array_data = ((long (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":197 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":198 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n     }\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":199 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -581,11 +581,11 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":207 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -594,7 +594,7 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":210 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -614,20 +614,20 @@ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":211 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":212 */\n     __pyx_v_array_data = ((long (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":213 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":214 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n     }\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":215 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -661,11 +661,11 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":224 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -674,7 +674,7 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":227 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -694,20 +694,20 @@ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":228 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":229 */\n     __pyx_v_array_data = ((long (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":230 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":232 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -741,11 +741,11 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":240 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":241 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}\n     __pyx_r = __pyx_2;\n     __pyx_2 = 0;\n@@ -754,7 +754,7 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":243 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -774,20 +774,20 @@ static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*_\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":244 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":245 */\n     __pyx_v_array_data = ((long (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":246 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":247 */\n       (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n     }\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":248 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -816,29 +816,29 @@ static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n   long __pyx_v_i;\n   double __pyx_r;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":253 */\n   __pyx_v_sum = (__pyx_v_darr[0]);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":254 */\n   __pyx_v_c = 0.0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":255 */\n   for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":256 */\n     __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":257 */\n     __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":258 */\n     __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":259 */\n     __pyx_v_sum = __pyx_v_t;\n   }\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":260 */\n   __pyx_r = __pyx_v_sum;\n   goto __pyx_L0;\n \n@@ -864,10 +864,10 @@ static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObje\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_seed);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":283 */\n   ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":285 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_seed);\n@@ -896,11 +896,11 @@ static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n   int __pyx_1;\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":288 */\n   __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":289 */\n     PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n     goto __pyx_L2;\n   }\n@@ -934,11 +934,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_seed);\n   arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":303 */\n   __pyx_1 = __pyx_v_seed == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":304 */\n     __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n     goto __pyx_L2;\n   }\n@@ -955,21 +955,21 @@ static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyOb\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":306 */\n     __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":308 */\n     __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":309 */\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@@ -1006,7 +1006,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":318 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -1027,10 +1027,10 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self,\n   arrayObject_state = ((PyArrayObject *)__pyx_1);\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":319 */\n   memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}\n   Py_INCREF(__pyx_n_MT19937);\n@@ -1087,7 +1087,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":331 */\n   __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -1095,12 +1095,12 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   __pyx_v_algorithm_name = __pyx_2;\n   __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":332 */\n   if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n   __pyx_3 = __pyx_3 != 0;\n   if (__pyx_3) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":333 */\n     __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n     Py_INCREF(__pyx_k62p);\n@@ -1115,7 +1115,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":334 */\n   __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n   __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n   Py_DECREF(__pyx_v_key);\n@@ -1128,18 +1128,18 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":335 */\n   __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":336 */\n   __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n   if (__pyx_3) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":337 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n     __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n     Py_INCREF(__pyx_k63p);\n@@ -1154,10 +1154,10 @@ static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self,\n   }\n   __pyx_L3:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":338 */\n   memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":339 */\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@@ -1187,7 +1187,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_se\n   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":343 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n   __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n@@ -1222,7 +1222,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_se\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_state);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":346 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_state);\n@@ -1261,7 +1261,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self\n   if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":349 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -1311,7 +1311,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_s\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1341,7 +1341,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1392,38 +1392,38 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_size);\n   arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":379 */\n   __pyx_1 = __pyx_v_high == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":380 */\n     __pyx_v_lo = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":381 */\n     __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n     __pyx_v_hi = __pyx_2;\n     goto __pyx_L2;\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":383 */\n     __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n     __pyx_v_lo = __pyx_2;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":384 */\n     __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n     __pyx_v_hi = __pyx_2;\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":386 */\n   __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":387 */\n   __pyx_1 = (__pyx_v_diff < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":388 */\n     __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n     __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n     Py_INCREF(__pyx_k64p);\n@@ -1438,11 +1438,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   }\n   __pyx_L3:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":390 */\n   __pyx_1 = __pyx_v_size == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; goto __pyx_L1;}\n     __pyx_r = __pyx_3;\n     __pyx_3 = 0;\n@@ -1451,7 +1451,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":393 */\n     __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n     __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n@@ -1471,20 +1471,20 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, P\n     arrayObject = ((PyArrayObject *)__pyx_4);\n     Py_DECREF(__pyx_4); __pyx_4 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":394 */\n     __pyx_v_length = PyArray_SIZE(arrayObject);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":395 */\n     __pyx_v_array_data = ((long (*))arrayObject->data);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":396 */\n     for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n-      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":397 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":398 */\n     Py_INCREF(((PyObject *)arrayObject));\n     __pyx_r = ((PyObject *)arrayObject);\n     goto __pyx_L0;\n@@ -1521,22 +1521,22 @@ static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyO\n   Py_INCREF(__pyx_v_self);\n   __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":406 */\n   __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":407 */\n   rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":408 */\n   __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n   Py_DECREF(__pyx_v_bytestring);\n   __pyx_v_bytestring = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":409 */\n   PyMem_Free(__pyx_v_bytes);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":410 */\n   Py_INCREF(__pyx_v_bytestring);\n   __pyx_r = __pyx_v_bytestring;\n   goto __pyx_L0;\n@@ -1569,7 +1569,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1611,7 +1611,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb\n   }\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":426 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_args);\n@@ -1626,7 +1626,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":427 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n     __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n@@ -1639,7 +1639,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyOb\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":429 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n     __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n@@ -1690,7 +1690,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO\n   }\n   Py_INCREF(__pyx_v_self);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":437 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_args);\n@@ -1705,7 +1705,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":438 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n     __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n@@ -1718,7 +1718,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyO\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":440 */\n     __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n     Py_INCREF(__pyx_v_args);\n@@ -1768,16 +1768,16 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v\n   Py_INCREF(__pyx_v_high);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":449 */\n   __pyx_1 = __pyx_v_high == Py_None;\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":450 */\n     Py_INCREF(__pyx_v_low);\n     Py_DECREF(__pyx_v_high);\n     __pyx_v_high = __pyx_v_low;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":451 */\n     __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;}\n     Py_DECREF(__pyx_v_low);\n     __pyx_v_low = __pyx_2;\n@@ -1786,7 +1786,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":452 */\n   __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n   __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n   __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n@@ -1833,7 +1833,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -1874,11 +1874,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":467 */\n   __pyx_1 = (__pyx_v_scale <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":468 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n     Py_INCREF(__pyx_k66p);\n@@ -1893,7 +1893,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, Py\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -1936,11 +1936,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":476 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":477 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n     Py_INCREF(__pyx_k67p);\n@@ -1956,7 +1956,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb\n   __pyx_1 = (__pyx_v_b <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":479 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n     Py_INCREF(__pyx_k68p);\n@@ -1971,7 +1971,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyOb\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2012,11 +2012,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":487 */\n   __pyx_1 = (__pyx_v_scale <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":488 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n     Py_INCREF(__pyx_k69p);\n@@ -2031,7 +2031,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_sel\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2063,7 +2063,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -2101,11 +2101,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":503 */\n   __pyx_1 = (__pyx_v_shape <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":504 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n     Py_INCREF(__pyx_k70p);\n@@ -2120,7 +2120,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2164,11 +2164,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":512 */\n   __pyx_1 = (__pyx_v_shape <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":513 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n     Py_INCREF(__pyx_k71p);\n@@ -2184,7 +2184,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO\n   __pyx_1 = (__pyx_v_scale <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":515 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n     Py_INCREF(__pyx_k72p);\n@@ -2199,7 +2199,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyO\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2242,11 +2242,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":523 */\n   __pyx_1 = (__pyx_v_dfnum <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":524 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n     Py_INCREF(__pyx_k73p);\n@@ -2262,7 +2262,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec\n   __pyx_1 = (__pyx_v_dfden <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":526 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n     Py_INCREF(__pyx_k74p);\n@@ -2277,7 +2277,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObjec\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2323,11 +2323,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":534 */\n   __pyx_1 = (__pyx_v_dfnum <= 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":535 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n     Py_INCREF(__pyx_k75p);\n@@ -2343,7 +2343,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   __pyx_1 = (__pyx_v_dfden <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":537 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n     Py_INCREF(__pyx_k76p);\n@@ -2359,7 +2359,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   __pyx_1 = (__pyx_v_nonc < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":539 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_k77p);\n@@ -2374,7 +2374,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_se\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2414,11 +2414,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":548 */\n   __pyx_1 = (__pyx_v_df <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":549 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n     Py_INCREF(__pyx_k78p);\n@@ -2433,7 +2433,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2476,11 +2476,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":557 */\n   __pyx_1 = (__pyx_v_df <= 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":558 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n     Py_INCREF(__pyx_k79p);\n@@ -2496,7 +2496,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__\n   __pyx_1 = (__pyx_v_nonc < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":560 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n     Py_INCREF(__pyx_k80p);\n@@ -2511,7 +2511,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2543,7 +2543,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; goto __pyx_L1;}\n   __pyx_r = __pyx_1;\n   __pyx_1 = 0;\n@@ -2581,11 +2581,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":576 */\n   __pyx_1 = (__pyx_v_df <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":577 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n     Py_INCREF(__pyx_k81p);\n@@ -2600,7 +2600,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2641,11 +2641,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":586 */\n   __pyx_1 = (__pyx_v_kappa < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":587 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n     Py_INCREF(__pyx_k82p);\n@@ -2660,7 +2660,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2700,11 +2700,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":595 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":596 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n     Py_INCREF(__pyx_k83p);\n@@ -2719,7 +2719,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, Py\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2759,11 +2759,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":604 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":605 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n     Py_INCREF(__pyx_k84p);\n@@ -2778,7 +2778,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, P\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2818,11 +2818,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":613 */\n   __pyx_1 = (__pyx_v_a <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":614 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n     Py_INCREF(__pyx_k85p);\n@@ -2837,7 +2837,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyO\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2880,11 +2880,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":622 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":623 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n     Py_INCREF(__pyx_k86p);\n@@ -2899,7 +2899,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, P\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -2942,11 +2942,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":631 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":632 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n     Py_INCREF(__pyx_k87p);\n@@ -2961,7 +2961,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, Py\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3004,11 +3004,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":640 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":641 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n     Py_INCREF(__pyx_k88p);\n@@ -3023,7 +3023,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3066,11 +3066,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":654 */\n   __pyx_1 = (__pyx_v_sigma <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":655 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n     Py_INCREF(__pyx_k89p);\n@@ -3085,7 +3085,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3126,11 +3126,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":663 */\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":664 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n     Py_INCREF(__pyx_k90p);\n@@ -3145,7 +3145,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3188,11 +3188,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":672 */\n   __pyx_1 = (__pyx_v_mean <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":673 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n     Py_INCREF(__pyx_k91p);\n@@ -3208,7 +3208,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb\n   __pyx_1 = (__pyx_v_scale <= 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":675 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n     Py_INCREF(__pyx_k92p);\n@@ -3223,7 +3223,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyOb\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3269,11 +3269,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":684 */\n   __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":685 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n     Py_INCREF(__pyx_k93p);\n@@ -3289,7 +3289,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":687 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n     Py_INCREF(__pyx_k94p);\n@@ -3305,7 +3305,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   __pyx_1 = (__pyx_v_left == __pyx_v_right);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":689 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_k95p);\n@@ -3320,7 +3320,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3365,11 +3365,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":699 */\n   __pyx_1 = (__pyx_v_n <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":700 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n     Py_INCREF(__pyx_k96p);\n@@ -3385,7 +3385,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":702 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n     Py_INCREF(__pyx_k97p);\n@@ -3401,7 +3401,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p > 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":704 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_k98p);\n@@ -3416,7 +3416,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3461,11 +3461,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":712 */\n   __pyx_1 = (__pyx_v_n <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":713 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n     Py_INCREF(__pyx_k99p);\n@@ -3481,7 +3481,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   __pyx_1 = (__pyx_v_p < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":715 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n     Py_INCREF(__pyx_k100p);\n@@ -3497,7 +3497,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   __pyx_1 = (__pyx_v_p > 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":717 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_k101p);\n@@ -3512,7 +3512,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3553,11 +3553,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":726 */\n   __pyx_1 = (__pyx_v_lam <= 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":727 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n     Py_INCREF(__pyx_k102p);\n@@ -3572,7 +3572,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, P\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3612,11 +3612,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":735 */\n   __pyx_1 = (__pyx_v_a <= 1.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":736 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n     Py_INCREF(__pyx_k103p);\n@@ -3631,7 +3631,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyOb\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3673,11 +3673,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":745 */\n   __pyx_1 = (__pyx_v_p < 0.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":746 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n     Py_INCREF(__pyx_k104p);\n@@ -3693,7 +3693,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p > 1.0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":748 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n     Py_INCREF(__pyx_k105p);\n@@ -3708,7 +3708,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3756,11 +3756,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":761 */\n   __pyx_1 = (__pyx_v_ngood < 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":762 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n     Py_INCREF(__pyx_k106p);\n@@ -3776,7 +3776,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   __pyx_1 = (__pyx_v_nbad < 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":764 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n     Py_INCREF(__pyx_k107p);\n@@ -3792,7 +3792,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":766 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_k108p);\n@@ -3808,7 +3808,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   __pyx_1 = (__pyx_v_nsample < 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":768 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_k109p);\n@@ -3823,7 +3823,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3865,11 +3865,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_size);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":777 */\n   __pyx_1 = (__pyx_v_p < 0);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":778 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n     Py_INCREF(__pyx_k110p);\n@@ -3885,7 +3885,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,\n   __pyx_1 = (__pyx_v_p > 1);\n   if (__pyx_1) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":780 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n     Py_INCREF(__pyx_k111p);\n@@ -3900,7 +3900,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self,\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; goto __pyx_L1;}\n   __pyx_r = __pyx_2;\n   __pyx_2 = 0;\n@@ -3975,7 +3975,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":802 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -3989,7 +3989,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_mean = __pyx_3;\n   __pyx_3 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":803 */\n   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n   __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4003,11 +4003,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_cov = __pyx_2;\n   __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":804 */\n   __pyx_4 = __pyx_v_size == Py_None;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":805 */\n     __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; goto __pyx_L1;}\n     Py_DECREF(__pyx_v_shape);\n     __pyx_v_shape = __pyx_1;\n@@ -4016,14 +4016,14 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":808 */\n   __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n   __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n@@ -4039,7 +4039,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":809 */\n     __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n     Py_INCREF(__pyx_k112p);\n@@ -4054,7 +4054,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L3:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":810 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n   __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n@@ -4086,7 +4086,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":811 */\n     __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n     Py_INCREF(__pyx_k113p);\n@@ -4101,7 +4101,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L4:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":812 */\n   __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n   __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n@@ -4118,7 +4118,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":813 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n     Py_INCREF(__pyx_k114p);\n@@ -4133,7 +4133,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L5:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":815 */\n   __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n   __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n@@ -4148,7 +4148,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":816 */\n     __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n     Py_INCREF(__pyx_v_shape);\n     PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n@@ -4159,7 +4159,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   }\n   __pyx_L6:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":817 */\n   __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n   __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n@@ -4172,7 +4172,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_final_shape = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":818 */\n   __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n   __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n   __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n@@ -4187,7 +4187,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":822 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n   __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n   __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n@@ -4210,7 +4210,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_x = __pyx_5;\n   __pyx_5 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":823 */\n   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n   __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4249,7 +4249,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":833 */\n   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n   __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4276,7 +4276,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":834 */\n   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n   __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4303,7 +4303,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   __pyx_v_x = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":837 */\n   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n   __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4319,7 +4319,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":838 */\n   __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n   __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_final_shape);\n@@ -4330,7 +4330,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__p\n   if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":839 */\n   Py_INCREF(__pyx_v_x);\n   __pyx_r = __pyx_v_x;\n   goto __pyx_L0;\n@@ -4398,7 +4398,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":857 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_pvals);\n@@ -4410,21 +4410,21 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n   __pyx_v_d = __pyx_4;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":858 */\n   __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":859 */\n   __pyx_v_pix = ((double (*))arrayObject_parr->data);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":861 */\n   __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n   if (__pyx_5) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":862 */\n     __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n     Py_INCREF(__pyx_k115p);\n@@ -4439,11 +4439,11 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":864 */\n   __pyx_5 = __pyx_v_size == Py_None;\n   if (__pyx_5) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":865 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n     PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n@@ -4466,7 +4466,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_5) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":867 */\n     __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n     __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n     Py_INCREF(__pyx_v_size);\n@@ -4480,7 +4480,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":869 */\n     __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n     __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n     PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n@@ -4493,7 +4493,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   }\n   __pyx_L3:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":871 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -4512,68 +4512,68 @@ static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_sel\n   __pyx_v_multin = __pyx_1;\n   __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":872 */\n   Py_INCREF(((PyObject *)__pyx_v_multin));\n   Py_DECREF(((PyObject *)arrayObject_mnarr));\n   arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":873 */\n   __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":874 */\n   __pyx_v_i = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":875 */\n   while (1) {\n     __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n     if (!__pyx_5) break;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":876 */\n     __pyx_v_Sum = 1.0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":877 */\n     __pyx_v_dn = __pyx_v_n;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":878 */\n     __pyx_4 = (__pyx_v_d - 1);\n     for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":880 */\n       __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":881 */\n       __pyx_5 = (__pyx_v_dn <= 0);\n       if (__pyx_5) {\n \n-        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n+        /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":882 */\n         goto __pyx_L7;\n         goto __pyx_L8;\n       }\n       __pyx_L8:;\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":883 */\n       __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n     }\n     __pyx_L7:;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":884 */\n     __pyx_5 = (__pyx_v_dn > 0);\n     if (__pyx_5) {\n \n-      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\n+      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":887 */\n     __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n   }\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":889 */\n   Py_INCREF(__pyx_v_multin);\n   __pyx_r = __pyx_v_multin;\n   goto __pyx_L0;\n@@ -4614,7 +4614,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P\n   Py_INCREF(__pyx_v_self);\n   Py_INCREF(__pyx_v_x);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":900 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_x);\n@@ -4630,15 +4630,15 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   __pyx_v_i = __pyx_4;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":901 */\n   while (1) {\n     __pyx_5 = (__pyx_v_i > 0);\n     if (!__pyx_5) break;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":902 */\n     __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":903 */\n     __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n     __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n     Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4654,7 +4654,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, P\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n     Py_DECREF(__pyx_3); __pyx_3 = 0;\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":904 */\n     __pyx_v_i = (__pyx_v_i - 1);\n   }\n \n@@ -4690,7 +4690,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   Py_INCREF(__pyx_v_x);\n   __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":912 */\n   __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_x);\n@@ -4704,7 +4704,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n   if (__pyx_4) {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":913 */\n     __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n     __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n     Py_DECREF(__pyx_2); __pyx_2 = 0;\n@@ -4721,7 +4721,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   }\n   /*else*/ {\n \n-    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n+    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":915 */\n     __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n     __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n     Py_DECREF(__pyx_3); __pyx_3 = 0;\n@@ -4737,7 +4737,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   }\n   __pyx_L2:;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":916 */\n   __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n   __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n   Py_INCREF(__pyx_v_arr);\n@@ -4747,7 +4747,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_sel\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n   Py_DECREF(__pyx_3); __pyx_3 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":917 */\n   Py_INCREF(__pyx_v_arr);\n   __pyx_r = __pyx_v_arr;\n   goto __pyx_L0;\n@@ -5119,503 +5119,503 @@ DL_EXPORT(void) initmtrand(void) {\n   if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n   __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":114 */\n   import_array();\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":116 */\n   __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n   if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":282 */\n   Py_INCREF(Py_None);\n   __pyx_k2 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":291 */\n   Py_INCREF(Py_None);\n   __pyx_k3 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":352 */\n   Py_INCREF(Py_None);\n   __pyx_k4 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":359 */\n   Py_INCREF(Py_None);\n   __pyx_k5 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":366 */\n   Py_INCREF(Py_None);\n   __pyx_k6 = Py_None;\n   Py_INCREF(Py_None);\n   __pyx_k7 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":412 */\n   __pyx_k8 = 0.0;\n   __pyx_k9 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k10 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":442 */\n   Py_INCREF(Py_None);\n   __pyx_k11 = Py_None;\n   Py_INCREF(Py_None);\n   __pyx_k12 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":455 */\n   Py_INCREF(Py_None);\n   __pyx_k13 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":462 */\n   __pyx_k14 = 0.0;\n   __pyx_k15 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k16 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":471 */\n   Py_INCREF(Py_None);\n   __pyx_k17 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":482 */\n   __pyx_k18 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k19 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":491 */\n   Py_INCREF(Py_None);\n   __pyx_k20 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":498 */\n   Py_INCREF(Py_None);\n   __pyx_k21 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":507 */\n   __pyx_k22 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k23 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":518 */\n   Py_INCREF(Py_None);\n   __pyx_k24 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":529 */\n   Py_INCREF(Py_None);\n   __pyx_k25 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":543 */\n   Py_INCREF(Py_None);\n   __pyx_k26 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":552 */\n   Py_INCREF(Py_None);\n   __pyx_k27 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":564 */\n   Py_INCREF(Py_None);\n   __pyx_k28 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":571 */\n   Py_INCREF(Py_None);\n   __pyx_k29 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":580 */\n   Py_INCREF(Py_None);\n   __pyx_k30 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":590 */\n   Py_INCREF(Py_None);\n   __pyx_k31 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":599 */\n   Py_INCREF(Py_None);\n   __pyx_k32 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":608 */\n   Py_INCREF(Py_None);\n   __pyx_k33 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":617 */\n   __pyx_k34 = 0.0;\n   __pyx_k35 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k36 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":626 */\n   __pyx_k37 = 0.0;\n   __pyx_k38 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k39 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":635 */\n   __pyx_k40 = 0.0;\n   __pyx_k41 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k42 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":644 */\n   __pyx_k43 = 0.0;\n   __pyx_k44 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k45 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":658 */\n   __pyx_k46 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k47 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":667 */\n   Py_INCREF(Py_None);\n   __pyx_k48 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":678 */\n   Py_INCREF(Py_None);\n   __pyx_k49 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":694 */\n   Py_INCREF(Py_None);\n   __pyx_k50 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":707 */\n   Py_INCREF(Py_None);\n   __pyx_k51 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":721 */\n   __pyx_k52 = 1.0;\n   Py_INCREF(Py_None);\n   __pyx_k53 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":730 */\n   Py_INCREF(Py_None);\n   __pyx_k54 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":739 */\n   Py_INCREF(Py_None);\n   __pyx_k55 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":751 */\n   Py_INCREF(Py_None);\n   __pyx_k56 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":772 */\n   Py_INCREF(Py_None);\n   __pyx_k57 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":784 */\n   Py_INCREF(Py_None);\n   __pyx_k58 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":841 */\n   Py_INCREF(Py_None);\n   __pyx_k59 = Py_None;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":919 */\n   __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":920 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":921 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":922 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":923 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":924 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":925 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":926 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":927 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":928 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":929 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":930 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":931 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":932 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":933 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":934 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":935 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":936 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":937 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":938 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":939 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":940 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":941 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":942 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":943 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":944 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":945 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":946 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":947 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":948 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":949 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":950 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":951 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":952 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":954 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":955 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":956 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":957 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":958 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":959 */\n   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n   __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n   Py_DECREF(__pyx_2); __pyx_2 = 0;\n \n-  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":960 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":962 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":963 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":965 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":966 */\n+  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n   Py_DECREF(__pyx_1); __pyx_1 = 0;\n@@ -5637,20 +5637,20 @@ statichere char **__pyx_f = __pyx_filenames;\n /* Runtime support code */\n \n static int __Pyx_GetStarArgs(\n-    PyObject **args,\n+    PyObject **args, \n     PyObject **kwds,\n-    char *kwd_list[],\n+    char *kwd_list[], \n     int nargs,\n-    PyObject **args2,\n+    PyObject **args2, \n     PyObject **kwds2)\n {\n     PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n-\n+    \n     if (args2)\n         *args2 = 0;\n     if (kwds2)\n         *kwds2 = 0;\n-\n+    \n     if (args2) {\n         args1 = PyTuple_GetSlice(*args, 0, nargs);\n         if (!args1)\n@@ -5663,7 +5663,7 @@ static int __Pyx_GetStarArgs(\n         args1 = *args;\n         Py_INCREF(args1);\n     }\n-\n+    \n     if (kwds2) {\n         if (*kwds) {\n             char **p;\n@@ -5693,7 +5693,7 @@ static int __Pyx_GetStarArgs(\n         kwds1 = *kwds;\n         Py_XINCREF(kwds1);\n     }\n-\n+    \n     *args = args1;\n     *kwds = kwds1;\n     return 0;\n@@ -5863,15 +5863,15 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n     return 0;\n }\n \n-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,\n-    long size)\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+    \n     py_module_name = PyString_FromString(module_name);\n     if (!py_module_name)\n         goto bad;\n@@ -5891,13 +5891,13 @@ static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,\n     if (!result)\n         goto bad;\n     if (!PyType_Check(result)) {\n-        PyErr_Format(PyExc_TypeError,\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+        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@@ -5925,7 +5925,7 @@ static void __Pyx_AddTraceback(char *funcname) {\n     PyObject *empty_string = 0;\n     PyCodeObject *py_code = 0;\n     PyFrameObject *py_frame = 0;\n-\n+    \n     py_srcfile = PyString_FromString(__pyx_filename);\n     if (!py_srcfile) goto bad;\n     py_funcname = PyString_FromString(funcname);\n",
                "added_lines": 395,
                "deleted_lines": 395,
                "source_code": "/* Generated by Pyrex 0.9.3.2a on Fri Oct 14 19:51:22 2005 */\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 \"scipy/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_ArrayType = 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_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_scipy;\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":132 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":148 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":165 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":182 */\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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":183 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":199 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":215 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":231 */\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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":232 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":248 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":289 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":309 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":339 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":397 */\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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":398 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":410 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":807 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)arrayObject_mnarr));\n  arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":879 */\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      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":885 */\n      (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n      goto __pyx_L9;\n    }\n    __pyx_L9:;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":889 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":904 */\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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_uniform); 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_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_rand); 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_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_randn); 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_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_integers); 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_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_normal); 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_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_normal); 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_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_beta); 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_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_exponential); 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_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_exponential); 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_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_gamma); 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_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_gamma); 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_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_f); 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_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_noncentral_f); 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_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_chisquare); 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_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_cauchy); 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_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_standard_t); 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_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_vonmises); 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_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_pareto); 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_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_weibull); 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_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_power); 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_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_laplace); 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_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_gumbel); 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_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_logistic); 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_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_lognormal); 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_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_rayleigh); 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_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_wald); 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_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_triangular); 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_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_binomial); 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_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_negative_binomial); 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_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_poisson); 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_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_zipf); 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_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_geometric); 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_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_logseries); 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_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_multinomial); 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_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_shuffle); 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_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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 <class>, <instance> */\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 Fri Oct 14 17:30:55 2005 */\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 \"scipy/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_ArrayType = 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_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_scipy;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; 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 = 127; 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 = 127; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */\n    __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; 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 = 143; 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 = 143; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */\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 = 158; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; 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 = 160; 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 = 160; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */\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 = 176; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; 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 = 178; 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 = 178; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */\n    __pyx_v_array_data = ((double (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; 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 = 194; 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 = 194; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */\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 = 208; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; 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 = 210; 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 = 210; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */\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 = 225; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; 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 = 227; 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 = 227; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; 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 = 243; 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 = 243; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */\n      (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */\n  __pyx_v_sum = (__pyx_v_darr[0]);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */\n  __pyx_v_c = 0.0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */\n  for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */\n    __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */\n    __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */\n    __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */\n    __pyx_v_sum = __pyx_v_t;\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */\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 PyObject *__pyx_n_seed;\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */\n  ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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 = 285; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */\n  __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */\n  __pyx_1 = __pyx_v_seed == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */\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 = 305; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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 = 305; 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 = 305; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */\n    __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */\n    __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; goto __pyx_L1;}\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;}\n  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 318; 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 = 318; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */\n  memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */\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 = 320; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */\n  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */\n  if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}\n  __pyx_3 = __pyx_3 != 0;\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; 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 = 333; 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 = 333; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */\n  __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}\n  __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; 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 = 334; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */\n  __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */\n  __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n  if (__pyx_3) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; 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 = 337; 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 = 337; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */\n  memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}\n  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; 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 = 346; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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 = 349; 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 = 349; goto __pyx_L1;}\n  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}\n  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; 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 = 349; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */\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 = 357; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */\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 = 364; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */\n    __pyx_v_lo = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n    goto __pyx_L2;\n  }\n  /*else*/ {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}\n    __pyx_v_lo = __pyx_2;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */\n    __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}\n    __pyx_v_hi = __pyx_2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */\n  __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */\n  __pyx_1 = (__pyx_v_diff < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; 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 = 388; 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 = 388; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */\n  __pyx_1 = __pyx_v_size == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */\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 = 391; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */\n    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; goto __pyx_L1;}\n    __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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 = 393; 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 = 393; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */\n    __pyx_v_length = PyArray_SIZE(arrayObject);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */\n    __pyx_v_array_data = ((long (*))arrayObject->data);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */\n    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */\n      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));\n    }\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */\n  __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */\n  rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */\n  __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; goto __pyx_L1;}\n  Py_DECREF(__pyx_v_bytestring);\n  __pyx_v_bytestring = __pyx_1;\n  __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */\n  PyMem_Free(__pyx_v_bytes);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */\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 = 417; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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 = 426; 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 = 426; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}\n    __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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 = 437; 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 = 437; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */\n    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; 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 = 440; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */\n  __pyx_1 = __pyx_v_high == Py_None;\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */\n    Py_INCREF(__pyx_v_low);\n    Py_DECREF(__pyx_v_high);\n    __pyx_v_high = __pyx_v_low;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */\n  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}\n  __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; 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 = 452; 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 = 452; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */\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 = 460; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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 = 468; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */\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 = 469; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; 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 = 477; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_b <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; 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 = 479; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */\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 = 480; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; 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 = 488; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */\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 = 489; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */\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 = 496; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; 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 = 504; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */\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 = 505; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */\n  __pyx_1 = (__pyx_v_shape <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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 = 513; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 515; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */\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 = 516; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */\n  __pyx_1 = (__pyx_v_dfnum <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; 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 = 524; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; 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 = 526; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */\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 = 527; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */\n  __pyx_1 = (__pyx_v_dfnum <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; 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 = 535; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_dfden <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; 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 = 537; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */\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 = 540; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; 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 = 549; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */\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 = 550; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */\n  __pyx_1 = (__pyx_v_df <= 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nonc < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; 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 = 560; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */\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 = 561; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */\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 = 569; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */\n  __pyx_1 = (__pyx_v_df <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; 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 = 577; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */\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 = 578; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */\n  __pyx_1 = (__pyx_v_kappa < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; 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 = 587; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */\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 = 588; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; 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 = 596; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */\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 = 597; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; 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 = 605; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */\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 = 606; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */\n  __pyx_1 = (__pyx_v_a <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; 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 = 614; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */\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 = 615; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; 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 = 623; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */\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 = 624; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; 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 = 632; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */\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 = 633; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 641; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */\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 = 642; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */\n  __pyx_1 = (__pyx_v_sigma <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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 = 655; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */\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 = 656; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; 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 = 664; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */\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 = 665; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */\n  __pyx_1 = (__pyx_v_mean <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; 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 = 673; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_scale <= 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; 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 = 675; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */\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 = 676; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */\n  __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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 = 685; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; 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 = 687; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_left == __pyx_v_right);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */\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 = 690; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; 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 = 700; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; 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 = 702; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */\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 = 705; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */\n  __pyx_1 = (__pyx_v_n <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; 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 = 713; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; 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 = 715; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */\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 = 718; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */\n  __pyx_1 = (__pyx_v_lam <= 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; 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 = 727; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */\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 = 728; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */\n  __pyx_1 = (__pyx_v_a <= 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; 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 = 736; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */\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 = 737; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */\n  __pyx_1 = (__pyx_v_p < 0.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 746; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1.0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; 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 = 748; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */\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 = 749; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */\n  __pyx_1 = (__pyx_v_ngood < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; 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 = 762; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_nbad < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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 = 764; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_nsample < 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_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 = 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_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */\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 = 769; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */\n  __pyx_1 = (__pyx_v_p < 0);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; 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 = 778; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_1 = (__pyx_v_p > 1);\n  if (__pyx_1) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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 = 780; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n    __Pyx_Raise(__pyx_4, 0, 0);\n    Py_DECREF(__pyx_4); __pyx_4 = 0;\n    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */\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 = 781; 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_linalg;\nstatic PyObject *__pyx_n_singular_value_decomposition;\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;\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\";\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_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_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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; 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 = 802; 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 = 802; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; 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 = 803; 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 = 803; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */\n  __pyx_4 = __pyx_v_size == Py_None;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */\n    __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;}\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 808; 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 = 808; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */\n    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; 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 = 809; 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 = 809; goto __pyx_L1;}\n    goto __pyx_L3;\n  }\n  __pyx_L3:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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 = 810; goto __pyx_L1;}\n  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; goto __pyx_L1;}\n    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;}\n    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; 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 = 810; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */\n    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; 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 = 811; 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 = 811; goto __pyx_L1;}\n    goto __pyx_L4;\n  }\n  __pyx_L4:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 812; goto __pyx_L1;}\n  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; 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 = 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 813; 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 = 813; goto __pyx_L1;}\n    goto __pyx_L5;\n  }\n  __pyx_L5:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; 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 = 815; 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 = 815; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  if (__pyx_4) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */\n    __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */\n  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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 = 817; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */\n  __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; 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 = 818; 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 = 818; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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 = 822; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 823; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; 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 = 823; 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 = 824; goto __pyx_L1;}\n  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; 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 = 823; 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 = 823; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_linalg); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_singular_value_decomposition); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_5); __pyx_5 = 0;\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 = 833; 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 = 833; 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 = 833; 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 = 833; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */\n  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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 = 834; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */\n  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;}\n  __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; 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 = 837; 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 = 837; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */\n  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n  __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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 = 838; 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 = 838; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */\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_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_k115p;\n\nstatic char (__pyx_k115[]) = \"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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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 = 857; 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 = 857; goto __pyx_L1;}\n  Py_DECREF(__pyx_3); __pyx_3 = 0;\n  __pyx_v_d = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */\n  __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */\n  __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */\n  __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */\n    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n    Py_INCREF(__pyx_k115p);\n    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p);\n    __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; 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 = 862; goto __pyx_L1;}\n    goto __pyx_L2;\n  }\n  __pyx_L2:;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */\n  __pyx_5 = __pyx_v_size == Py_None;\n  if (__pyx_5) {\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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 = 866; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; 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 = 866; 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 = 866; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */\n    __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */\n    __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;}\n    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 869; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; goto __pyx_L1;}\n  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; 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 = 871; 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 = 871; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */\n  Py_INCREF(((PyObject *)__pyx_v_multin));\n  Py_DECREF(((PyObject *)arrayObject_mnarr));\n  arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */\n  __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */\n  __pyx_v_i = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */\n    __pyx_v_Sum = 1.0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */\n    __pyx_v_dn = __pyx_v_n;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */\n    __pyx_4 = (__pyx_v_d - 1);\n    for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */\n      __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */\n      __pyx_5 = (__pyx_v_dn <= 0);\n      if (__pyx_5) {\n\n        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */\n        goto __pyx_L7;\n        goto __pyx_L8;\n      }\n      __pyx_L8:;\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */\n      __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n    }\n    __pyx_L7:;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */\n    __pyx_5 = (__pyx_v_dn > 0);\n    if (__pyx_5) {\n\n      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */\n    __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n  }\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; 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 = 900; goto __pyx_L1;}\n  __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; 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 = 900; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n  __pyx_v_i = __pyx_4;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */\n  while (1) {\n    __pyx_5 = (__pyx_v_i > 0);\n    if (!__pyx_5) break;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */\n    __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */\n    __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; 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 = 903; goto __pyx_L1;}\n    if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}\n    Py_DECREF(__pyx_2); __pyx_2 = 0;\n    Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */\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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */\n  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; 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 = 912; 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 = 912; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */\n    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}\n    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; 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 = 913; 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 = 913; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */\n    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;}\n    __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; 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 = 915; 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 = 915; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */\n  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;}\n  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; 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 = 916; 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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */\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_linalg, \"linalg\"},\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_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_scipy, \"scipy\"},\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_singular_value_decomposition, \"singular_value_decomposition\"},\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_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  {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 scipy array filled with generated values\\n    is returned. If size is a tuple, then a scipy 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_ArrayType = __Pyx_ImportType(\"scipy\", \"ArrayType\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ArrayType) {__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 = 262; goto __pyx_L1;}\n  if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}\n  __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */\n  import_array();\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */\n  __pyx_1 = __Pyx_Import(__pyx_n_scipy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}\n  Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */\n  Py_INCREF(Py_None);\n  __pyx_k2 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */\n  Py_INCREF(Py_None);\n  __pyx_k3 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */\n  Py_INCREF(Py_None);\n  __pyx_k4 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */\n  Py_INCREF(Py_None);\n  __pyx_k5 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */\n  Py_INCREF(Py_None);\n  __pyx_k6 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k7 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */\n  __pyx_k8 = 0.0;\n  __pyx_k9 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k10 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */\n  Py_INCREF(Py_None);\n  __pyx_k11 = Py_None;\n  Py_INCREF(Py_None);\n  __pyx_k12 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */\n  Py_INCREF(Py_None);\n  __pyx_k13 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */\n  __pyx_k14 = 0.0;\n  __pyx_k15 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k16 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */\n  Py_INCREF(Py_None);\n  __pyx_k17 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */\n  __pyx_k18 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k19 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */\n  Py_INCREF(Py_None);\n  __pyx_k20 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */\n  Py_INCREF(Py_None);\n  __pyx_k21 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */\n  __pyx_k22 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k23 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */\n  Py_INCREF(Py_None);\n  __pyx_k24 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */\n  Py_INCREF(Py_None);\n  __pyx_k25 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */\n  Py_INCREF(Py_None);\n  __pyx_k26 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */\n  Py_INCREF(Py_None);\n  __pyx_k27 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */\n  Py_INCREF(Py_None);\n  __pyx_k28 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */\n  Py_INCREF(Py_None);\n  __pyx_k29 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */\n  Py_INCREF(Py_None);\n  __pyx_k30 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */\n  Py_INCREF(Py_None);\n  __pyx_k31 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */\n  Py_INCREF(Py_None);\n  __pyx_k32 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */\n  Py_INCREF(Py_None);\n  __pyx_k33 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */\n  __pyx_k34 = 0.0;\n  __pyx_k35 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k36 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */\n  __pyx_k37 = 0.0;\n  __pyx_k38 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k39 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */\n  __pyx_k40 = 0.0;\n  __pyx_k41 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k42 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */\n  __pyx_k43 = 0.0;\n  __pyx_k44 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k45 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */\n  __pyx_k46 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k47 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */\n  Py_INCREF(Py_None);\n  __pyx_k48 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */\n  Py_INCREF(Py_None);\n  __pyx_k49 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */\n  Py_INCREF(Py_None);\n  __pyx_k50 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */\n  Py_INCREF(Py_None);\n  __pyx_k51 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */\n  __pyx_k52 = 1.0;\n  Py_INCREF(Py_None);\n  __pyx_k53 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */\n  Py_INCREF(Py_None);\n  __pyx_k54 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */\n  Py_INCREF(Py_None);\n  __pyx_k55 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */\n  Py_INCREF(Py_None);\n  __pyx_k56 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */\n  Py_INCREF(Py_None);\n  __pyx_k57 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */\n  Py_INCREF(Py_None);\n  __pyx_k58 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */\n  Py_INCREF(Py_None);\n  __pyx_k59 = Py_None;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */\n  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; 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 = 919; 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 = 919; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; 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 = 920; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; 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 = 921; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 922; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; 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 = 923; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); 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_bytes, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_uniform); 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_uniform, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rand); 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_rand, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_randn); 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_randn, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_integers); 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_integers, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_normal); 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_standard_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_normal); 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_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_beta); 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_beta, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_exponential); 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_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_exponential); 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_standard_exponential, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_gamma); 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_standard_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gamma); 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_gamma, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_f); 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_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_f); 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_noncentral_f, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_chisquare); 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_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_noncentral_chisquare); 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_noncentral_chisquare, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_cauchy); 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_cauchy, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_standard_t); 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_standard_t, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_vonmises); 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_vonmises, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_pareto); 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_pareto, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_weibull); 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_weibull, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_power); 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_power, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_laplace); 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_laplace, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_gumbel); 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_gumbel, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logistic); 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_logistic, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_lognormal); 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_lognormal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_rayleigh); 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_rayleigh, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_wald); 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_wald, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_triangular); 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_triangular, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_binomial); 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_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_negative_binomial); 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_negative_binomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_poisson); 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_poisson, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_zipf); 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_zipf, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_geometric); 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_geometric, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */\n  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;}\n  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; 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 = 959; goto __pyx_L1;}\n  Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_logseries); 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_logseries, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multivariate_normal); 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_multivariate_normal, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_multinomial); 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_multinomial, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_shuffle); 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_shuffle, __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/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/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_permutation); 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_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; 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  \"scipy.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 <class>, <instance> */\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": 169,
                        "end_line": 247,
                        "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": 249,
                        "end_line": 327,
                        "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": 329,
                        "end_line": 407,
                        "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": 409,
                        "end_line": 487,
                        "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": 491,
                        "end_line": 569,
                        "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": 571,
                        "end_line": 649,
                        "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": 651,
                        "end_line": 729,
                        "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": 731,
                        "end_line": 809,
                        "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": 811,
                        "end_line": 850,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3948,
                        "end_line": 4359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 4369,
                        "end_line": 4598,
                        "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": 4602,
                        "end_line": 4673,
                        "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": 4679,
                        "end_line": 4768,
                        "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": 4906,
                        "end_line": 4910,
                        "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": 4912,
                        "end_line": 4923,
                        "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": 4925,
                        "end_line": 4927,
                        "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": 4929,
                        "end_line": 4931,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5107,
                        "end_line": 5629,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 5639,
                        "end_line": 5706,
                        "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": 5708,
                        "end_line": 5739,
                        "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": 5741,
                        "end_line": 5747,
                        "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": 5749,
                        "end_line": 5758,
                        "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": 5760,
                        "end_line": 5820,
                        "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": 5822,
                        "end_line": 5824,
                        "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": 5826,
                        "end_line": 5833,
                        "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": 5835,
                        "end_line": 5844,
                        "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": 5846,
                        "end_line": 5854,
                        "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": 5856,
                        "end_line": 5864,
                        "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": 5866,
                        "end_line": 5914,
                        "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": 5920,
                        "end_line": 5972,
                        "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": 169,
                        "end_line": 247,
                        "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": 249,
                        "end_line": 327,
                        "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": 329,
                        "end_line": 407,
                        "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": 409,
                        "end_line": 487,
                        "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": 491,
                        "end_line": 569,
                        "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": 571,
                        "end_line": 649,
                        "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": 651,
                        "end_line": 729,
                        "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": 731,
                        "end_line": 809,
                        "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": 811,
                        "end_line": 850,
                        "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": 996,
                        "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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3948,
                        "end_line": 4359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 4369,
                        "end_line": 4598,
                        "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": 4602,
                        "end_line": 4673,
                        "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": 4679,
                        "end_line": 4768,
                        "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": 4906,
                        "end_line": 4910,
                        "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": 4912,
                        "end_line": 4923,
                        "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": 4925,
                        "end_line": 4927,
                        "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": 4929,
                        "end_line": 4931,
                        "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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5107,
                        "end_line": 5629,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 5639,
                        "end_line": 5706,
                        "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": 5708,
                        "end_line": 5739,
                        "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": 5741,
                        "end_line": 5747,
                        "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": 5749,
                        "end_line": 5758,
                        "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": 5760,
                        "end_line": 5820,
                        "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": 5822,
                        "end_line": 5824,
                        "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": 5826,
                        "end_line": 5833,
                        "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": 5835,
                        "end_line": 5844,
                        "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": 5846,
                        "end_line": 5854,
                        "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": 5856,
                        "end_line": 5864,
                        "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": 5866,
                        "end_line": 5914,
                        "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": 5920,
                        "end_line": 5972,
                        "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": 329,
                        "end_line": 407,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 79,
                        "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": 5920,
                        "end_line": 5972,
                        "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": 4679,
                        "end_line": 4768,
                        "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_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": 731,
                        "end_line": 809,
                        "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_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_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": 5866,
                        "end_line": 5914,
                        "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_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": 249,
                        "end_line": 327,
                        "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_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": 811,
                        "end_line": 850,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 40,
                        "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_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_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": 367,
                        "complexity": 119,
                        "token_count": 4997,
                        "parameters": [
                            "__pyx_v_self",
                            "__pyx_args",
                            "__pyx_kwds"
                        ],
                        "start_line": 3948,
                        "end_line": 4359,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 412,
                        "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": 651,
                        "end_line": 729,
                        "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_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": 349,
                        "complexity": 146,
                        "token_count": 5618,
                        "parameters": [],
                        "start_line": 5107,
                        "end_line": 5629,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 523,
                        "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": 491,
                        "end_line": 569,
                        "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": 571,
                        "end_line": 649,
                        "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": 4602,
                        "end_line": 4673,
                        "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": 4369,
                        "end_line": 4598,
                        "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_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_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_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": 5639,
                        "end_line": 5706,
                        "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_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": 169,
                        "end_line": 247,
                        "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": 409,
                        "end_line": 487,
                        "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": 4955,
                "complexity": 904,
                "token_count": 47860,
                "diff_parsed": {
                    "added": [
                        "/* Generated by Pyrex 0.9.3.2a on Fri Oct 14 19:51:22 2005 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":124 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":125 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":127 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":128 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":129 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":130 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":131 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":132 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":140 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":141 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":143 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":144 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":145 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":146 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":147 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":148 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":157 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":158 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":160 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":161 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":162 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":163 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":164 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":165 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":175 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":176 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":178 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":179 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":180 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":181 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":182 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":183 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":191 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":192 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":194 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":195 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":196 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":197 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":198 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":199 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":207 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":208 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":210 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":211 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":212 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":213 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":214 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":215 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":224 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":225 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":227 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":228 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":229 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":230 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":231 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":232 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":240 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":241 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":243 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":244 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":245 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":246 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":247 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":248 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":253 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":254 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":255 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":256 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":257 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":258 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":259 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":260 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":283 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":285 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":288 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":289 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":303 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":304 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":306 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":308 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":309 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":318 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":319 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":320 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":331 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":332 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":333 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":334 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":335 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":336 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":337 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":338 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":339 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":343 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":346 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":349 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":357 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":364 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":379 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":380 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":381 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":383 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":384 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":386 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":387 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":388 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":390 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":391 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":393 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":394 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":395 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":396 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":397 */",
                        "      (__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)));",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":398 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":406 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":407 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":408 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":409 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":410 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":417 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":426 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":427 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":429 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":437 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":438 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":440 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":449 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":450 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":451 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":452 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":460 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":467 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":468 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":469 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":476 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":477 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":479 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":480 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":487 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":488 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":489 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":496 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":503 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":504 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":505 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":512 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":513 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":515 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":516 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":523 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":524 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":526 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":527 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":534 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":535 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":537 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":539 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":540 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":548 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":549 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":550 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":557 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":558 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":560 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":561 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":569 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":576 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":577 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":578 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":586 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":587 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":588 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":595 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":596 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":597 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":604 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":605 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":606 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":613 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":614 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":615 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":622 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":623 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":624 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":631 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":632 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":633 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":640 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":641 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":642 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":654 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":655 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":656 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":663 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":664 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":665 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":672 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":673 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":675 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":676 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":684 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":685 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":687 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":689 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":690 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":699 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":700 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":702 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":704 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":705 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":712 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":713 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":715 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":717 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":718 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":726 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":727 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":728 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":735 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":736 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":737 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":745 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":746 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":748 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":749 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":761 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":762 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":764 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":766 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":768 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":769 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":777 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":778 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":780 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":781 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":802 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":803 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":804 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":805 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":807 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":808 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":809 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":810 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":811 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":812 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":813 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":815 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":816 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":817 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":818 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":822 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":823 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":833 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":834 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":837 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":838 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":839 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":857 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":858 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":859 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":861 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":862 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":864 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":865 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":867 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":869 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":871 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":872 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":873 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":874 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":875 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":876 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":877 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":878 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":879 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":880 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":881 */",
                        "        /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":882 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":883 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":884 */",
                        "      /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":885 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":887 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":889 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":900 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":901 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":902 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":903 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":904 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":912 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":913 */",
                        "    /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":915 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":916 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":917 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":114 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":116 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":282 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":291 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":352 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":359 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":366 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":412 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":442 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":455 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":462 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":471 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":482 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":491 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":498 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":507 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":518 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":529 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":543 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":552 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":564 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":571 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":580 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":590 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":599 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":608 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":617 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":626 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":635 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":644 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":658 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":667 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":678 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":694 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":707 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":721 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":730 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":739 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":751 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":772 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":784 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":841 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":919 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":920 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":921 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":922 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":923 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":924 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":925 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":926 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":927 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":928 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":929 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":930 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":931 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":932 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":933 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":934 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":935 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":936 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":937 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":938 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":939 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":940 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":941 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":942 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":943 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":944 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":945 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":946 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":947 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":948 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":949 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":950 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":951 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":952 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":954 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":955 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":956 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":957 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":958 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":959 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":960 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":962 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":963 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":965 */",
                        "  /* \"/Users/kern/svk-projects/scipy_core/scipy/corelib/mtrand/mtrand.pyx\":966 */",
                        "    PyObject **args,",
                        "    char *kwd_list[],",
                        "    PyObject **args2,",
                        "",
                        "",
                        "",
                        "",
                        "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,",
                        "    long size)",
                        "",
                        "        PyErr_Format(PyExc_TypeError,",
                        "        PyErr_Format(PyExc_ValueError,",
                        ""
                    ],
                    "deleted": [
                        "/* Generated by Pyrex 0.9.3.1 on Fri Oct 14 17:30:55 2005 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":124 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":125 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":127 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":128 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":129 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":130 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":131 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":132 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":140 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":141 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":143 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":144 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":145 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":146 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":147 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":148 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":157 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":158 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":160 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":161 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":162 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":163 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":164 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":165 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":175 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":176 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":178 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":179 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":180 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":181 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":182 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":183 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":191 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":192 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":194 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":195 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":196 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":197 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":198 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":199 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":207 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":208 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":210 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":211 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":212 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":213 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":214 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":215 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":224 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":225 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":227 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":228 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":229 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":230 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":231 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":232 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":240 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":241 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":243 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":244 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":245 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":246 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":247 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":248 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":253 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":254 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":255 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":256 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":257 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":258 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":259 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":260 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":283 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":285 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":288 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":289 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":303 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":304 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":306 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":308 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":309 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":318 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":319 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":320 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":331 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":332 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":333 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":334 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":335 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":336 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":337 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":338 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":339 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":343 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":346 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":349 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":357 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":364 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":379 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":380 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":381 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":383 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":384 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":386 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":387 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":388 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":390 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":391 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":393 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":394 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":395 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":396 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":397 */",
                        "      (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state));",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":398 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":406 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":407 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":408 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":409 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":410 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":417 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":426 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":427 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":429 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":437 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":438 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":440 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":449 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":450 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":451 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":452 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":460 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":467 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":468 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":469 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":476 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":477 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":479 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":480 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":487 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":488 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":489 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":496 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":503 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":504 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":505 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":512 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":513 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":515 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":516 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":523 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":524 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":526 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":527 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":534 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":535 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":537 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":539 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":540 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":548 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":549 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":550 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":557 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":558 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":560 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":561 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":569 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":576 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":577 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":578 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":586 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":587 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":588 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":595 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":596 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":597 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":604 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":605 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":606 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":613 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":614 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":615 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":622 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":623 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":624 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":631 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":632 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":633 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":640 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":641 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":642 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":654 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":655 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":656 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":663 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":664 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":665 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":672 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":673 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":675 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":676 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":684 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":685 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":687 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":689 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":690 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":699 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":700 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":702 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":704 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":705 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":712 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":713 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":715 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":717 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":718 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":726 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":727 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":728 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":735 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":736 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":737 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":745 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":746 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":748 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":749 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":761 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":762 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":764 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":766 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":768 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":769 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":777 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":778 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":780 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":781 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":802 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":803 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":804 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":805 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":807 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":808 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":809 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":810 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":811 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":812 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":813 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":815 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":816 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":817 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":818 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":822 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":823 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":833 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":834 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":837 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":838 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":839 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":857 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":858 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":859 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":861 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":862 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":864 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":865 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":867 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":869 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":871 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":872 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":873 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":874 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":875 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":876 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":877 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":878 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":879 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":880 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":881 */",
                        "        /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":882 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":883 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":884 */",
                        "      /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":885 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":887 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":889 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":900 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":901 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":902 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":903 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":904 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":912 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":913 */",
                        "    /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":915 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":916 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":917 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":114 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":116 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":282 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":291 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":352 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":359 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":366 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":412 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":442 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":455 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":462 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":471 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":482 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":491 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":498 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":507 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":518 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":529 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":543 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":552 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":564 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":571 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":580 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":590 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":599 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":608 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":617 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":626 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":635 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":644 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":658 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":667 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":678 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":694 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":707 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":721 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":730 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":739 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":751 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":772 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":784 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":841 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":919 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":920 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":921 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":922 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":923 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":924 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":925 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":926 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":927 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":928 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":929 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":930 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":931 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":932 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":933 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":934 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":935 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":936 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":937 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":938 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":939 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":940 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":941 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":942 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":943 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":944 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":945 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":946 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":947 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":948 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":949 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":950 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":951 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":952 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":954 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":955 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":956 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":957 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":958 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":959 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":960 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":962 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":963 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":965 */",
                        "  /* \"/home/cookedm/stuff/python/scipy/scipy_core-newcore/scipy/corelib/mtrand/mtrand.pyx\":966 */",
                        "    PyObject **args,",
                        "    char *kwd_list[],",
                        "    PyObject **args2,",
                        "",
                        "",
                        "",
                        "",
                        "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,",
                        "    long size)",
                        "",
                        "        PyErr_Format(PyExc_TypeError,",
                        "        PyErr_Format(PyExc_ValueError,",
                        ""
                    ]
                }
            },
            {
                "old_path": "scipy/corelib/mtrand/mtrand.pyx",
                "new_path": "scipy/corelib/mtrand/mtrand.pyx",
                "filename": "mtrand.pyx",
                "extension": "pyx",
                "change_type": "MODIFY",
                "diff": "@@ -394,7 +394,7 @@ def randint(self, low, high=None, size=None):\n             length = PyArray_SIZE(array)\n             array_data = <long *>array.data\n             for i from 0 <= i < length:\n-                array_data[i] = lo + rk_interval(diff, self.internal_state)\n+                array_data[i] = lo + <long>rk_interval(diff, self.internal_state)\n             return array\n \n     def bytes(self, unsigned int length):\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 \"scipy.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_negative_binomial(rk_state *state, long n, double p)\n    long rk_poisson(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 scipy\nimport_array()\n\nimport scipy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n    cdef double *array_data\n    cdef ArrayType array \"arrayObject\"\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array \"arrayObject\"\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 scipy array filled with generated values\n    is returned. If size is a tuple, then a scipy 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 = <rk_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 ArrayType 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 = <ArrayType>PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n            init_by_array(self.internal_state, <unsigned long *>(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 ArrayType state \"arrayObject_state\"\n        state = <ArrayType>_sp.empty(624, _sp.Int)\n        memcpy(<void*>(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 ArrayType 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 = <ArrayType>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, <void*>(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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n            length = PyArray_SIZE(array)\n            array_data = <long *>array.data\n            for i from 0 <= i < length:\n                array_data[i] = lo + <long>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(<char*>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        # XXX: we really should be doing this by Cholesky decomposition\n        (u,s,v) = _sp.linalg.singular_value_decomposition(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 ArrayType 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 = <ArrayType>PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n        pix = <double*>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 = <ArrayType>multin\n        mnix = <long*>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()\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 \"scipy.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_negative_binomial(rk_state *state, long n, double p)\n    long rk_poisson(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 scipy\nimport_array()\n\nimport scipy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n    cdef double *array_data\n    cdef ArrayType array \"arrayObject\"\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Float64)\n        length = PyArray_SIZE(array)\n        array_data = <double *>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 ArrayType array \"arrayObject\"\n    cdef long length\n    cdef long i\n\n    if size is None:\n        return func(state)\n    else:\n        array = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n        length = PyArray_SIZE(array)\n        array_data = <long *>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 scipy array filled with generated values\n    is returned. If size is a tuple, then a scipy 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 = <rk_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 ArrayType 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 = <ArrayType>PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n            init_by_array(self.internal_state, <unsigned long *>(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 ArrayType state \"arrayObject_state\"\n        state = <ArrayType>_sp.empty(624, _sp.Int)\n        memcpy(<void*>(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 ArrayType 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 = <ArrayType>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, <void*>(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 ArrayType 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 = <ArrayType>_sp.empty(size, _sp.Int)\n            length = PyArray_SIZE(array)\n            array_data = <long *>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(<char*>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        # XXX: we really should be doing this by Cholesky decomposition\n        (u,s,v) = _sp.linalg.singular_value_decomposition(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 ArrayType 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 = <ArrayType>PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n        pix = <double*>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 = <ArrayType>multin\n        mnix = <long*>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()\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": [
                        "                array_data[i] = lo + <long>rk_interval(diff, self.internal_state)"
                    ],
                    "deleted": [
                        "                array_data[i] = lo + rk_interval(diff, self.internal_state)"
                    ]
                }
            }
        ]
    },
    {
        "hash": "299720f0b383d90fbf38a18cee1864d0090515bf",
        "msg": "r409@Blasphemy:  kern | 2005-10-14 20:26:04 -0700\n Comment out unused RCS crud",
        "author": {
            "name": "Robert Kern",
            "email": "robert.kern@gmail.com"
        },
        "committer": {
            "name": "Robert Kern",
            "email": "robert.kern@gmail.com"
        },
        "author_date": "2005-10-15T17:52:17+00:00",
        "author_timezone": 0,
        "committer_date": "2005-10-15T17:52:17+00:00",
        "committer_timezone": 0,
        "branches": [
            "main"
        ],
        "in_main_branch": true,
        "merge": false,
        "parents": [
            "6e62330243f7e5a1e6b21b144a11903b0bd7d79a"
        ],
        "project_name": "repo_copy",
        "project_path": "/tmp/tmp0d3e5gnv/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": "scipy/corelib/mtrand/randomkit.c",
                "new_path": "scipy/corelib/mtrand/randomkit.c",
                "filename": "randomkit.c",
                "extension": "c",
                "change_type": "MODIFY",
                "diff": "@@ -62,8 +62,8 @@\n  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n  */\n \n-static char const rcsid[] =\n-  \"@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $\";\n+/* static char const rcsid[] =\n+  \"@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $\"; */\n \n #include <stddef.h>\n #include <stdio.h>\n",
                "added_lines": 2,
                "deleted_lines": 2,
                "source_code": "/* Random kit 1.3 */\n\n/*\n * Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org)\n *\n * The rk_random and rk_seed functions algorithms and the original design of \n * the Mersenne Twister RNG:\n *\n *   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n *   All rights reserved.\n *\n *   Redistribution and use in source and binary forms, with or without\n *   modification, are permitted provided that the following conditions\n *   are met:\n * \n *   1. Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n *   2. Redistributions in binary form must reproduce the above copyright\n *   notice, this list of conditions and the following disclaimer in the\n *   documentation and/or other materials provided with the distribution.\n *\n *   3. The names of its contributors may not be used to endorse or promote\n *   products derived from this software without specific prior written\n *   permission.\n *\n *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n *   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n *   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n *   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n *   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n * \n * Original algorithm for the implementation of rk_interval function from\n * Richard J. Wagner's implementation of the Mersenne Twister RNG, optimised by\n * Magnus Jonsson.\n *\n * Constants used in the rk_double implementation by Isaku Wada.\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 */\n\n/* static char const rcsid[] =\n  \"@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $\"; */\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\n#include <time.h>\n#include <limits.h>\n#include <math.h>\n\n#ifdef _WIN32\n/* Windows */\n#include <sys/timeb.h>\n#ifndef RK_NO_WINCRYPT\n/* Windows crypto */\n#ifndef _WIN32_WINNT\n#define _WIN32_WINNT 0x0400\n#endif\n#include <windows.h>\n#include <wincrypt.h>\n#endif\n#else\n/* Unix */\n#include <sys/time.h>\n#include <unistd.h>\n#endif\n\n#include \"randomkit.h\"\n\n#ifndef RK_DEV_URANDOM\n#define RK_DEV_URANDOM \"/dev/urandom\"\n#endif\n\n#ifndef RK_DEV_RANDOM\n#define RK_DEV_RANDOM \"/dev/random\"\n#endif\n\nchar *rk_strerror[RK_ERR_MAX] =\n{\n\t\"no error\",\n\t\"random device unvavailable\"\n};\n\n/* static functions */\nstatic unsigned long rk_hash(unsigned long key);\n\nvoid rk_seed(unsigned long seed, rk_state *state)\n{\n\tint pos;\n\tseed &= 0xffffffffUL;\n\n\t/* Knuth's PRNG as used in the Mersenne Twister reference implementation */\n\tfor (pos=0; pos<RK_STATE_LEN; pos++)\n\t{\n\t\tstate->key[pos] = seed;\n\t\tseed = (1812433253UL * (seed ^ (seed >> 30)) + pos + 1) & 0xffffffffUL;\n\t}\n\n\tstate->pos = RK_STATE_LEN;\n\tstate->has_gauss = 0;\n}\n\n/* Thomas Wang 32 bits integer hash function */\nunsigned long rk_hash(unsigned long key)\n{\n  key += ~(key << 15);\n  key ^=  (key >> 10);\n  key +=  (key << 3);\n  key ^=  (key >> 6);\n  key += ~(key << 11);\n  key ^=  (key >> 16);\n  return key;\n}\n\nrk_error rk_randomseed(rk_state *state)\n{\n#ifndef _WIN32\n\tstruct timeval tv;\n#else\n\tstruct _timeb\ttv;\n#endif\n\n\tif(rk_devfill(state->key, sizeof(state->key), 0) == RK_NOERR)\n\t{\n\t\tstate->key[0] |= 0x80000000UL; /* ensures non-zero key */\n\t\tstate->pos = RK_STATE_LEN;\n\t\tstate->has_gauss = 0;\n\t\treturn RK_NOERR;\n\t}\n\n#ifndef _WIN32\n\tgettimeofday(&tv, NULL);\n\trk_seed(rk_hash(getpid()) ^ rk_hash(tv.tv_sec) ^ rk_hash(tv.tv_usec)\n\t\t^ rk_hash(clock()), state);\n#else\n\t_ftime(&tv);\n\trk_seed(rk_hash(tv.time) ^ rk_hash(tv.millitm) ^ rk_hash(clock()), state);\n#endif\n\n\treturn RK_ENODEV;\n}\n\n/* Magic Mersenne Twister constants */\n#define N 624\n#define M 397\n#define MATRIX_A 0x9908b0dfUL\n#define UPPER_MASK 0x80000000UL\n#define LOWER_MASK 0x7fffffffUL\n\n/* Slightly optimised reference implementation of the Mersenne Twister */\nunsigned long rk_random(rk_state *state)\n{\n  unsigned long y;\n\n  if (state->pos == RK_STATE_LEN)\n\t{\n    int i;\n\n    for (i=0;i<N-M;i++)\n\t\t{\n      y = (state->key[i] & UPPER_MASK) | (state->key[i+1] & LOWER_MASK);\n      state->key[i] = state->key[i+M] ^ (y>>1) ^ (-(y & 1) & MATRIX_A);\n    }\n    for (;i<N-1;i++)\n\t\t{\n      y = (state->key[i] & UPPER_MASK) | (state->key[i+1] & LOWER_MASK);\n      state->key[i] = state->key[i+(M-N)] ^ (y>>1) ^ (-(y & 1) & MATRIX_A);\n    }\n    y = (state->key[N-1] & UPPER_MASK) | (state->key[0] & LOWER_MASK);\n    state->key[N-1] = state->key[M-1] ^ (y>>1) ^ (-(y & 1) & MATRIX_A);\n\n    state->pos = 0;\n  }\n  \n  y = state->key[state->pos++];\n\n  /* Tempering */\n  y ^= (y >> 11);\n  y ^= (y << 7) & 0x9d2c5680UL;\n  y ^= (y << 15) & 0xefc60000UL;\n  y ^= (y >> 18);\n\n  return y;\n}\n\nlong rk_long(rk_state *state)\n{\n\treturn rk_ulong(state) >> 1;\n}\n\nunsigned long rk_ulong(rk_state *state)\n{\n#if ULONG_MAX <= 0xffffffffUL\n\treturn rk_random(state);\n#else\n\treturn (rk_random(state) << 32) | (rk_random(state));\n#endif\n}\n\nunsigned long rk_interval(unsigned long max, rk_state *state)\n{\n\tunsigned long mask = max, value;\n\n\tif (max == 0) return 0;\n\n\t/* Smallest bit mask >= max */\n\tmask |= mask >> 1;\n\tmask |= mask >> 2;\n\tmask |= mask >> 4;\n\tmask |= mask >> 8;\n\tmask |= mask >> 16;\n#if ULONG_MAX > 0xffffffffUL\n\tmask |= mask >> 32;\n#endif\n\n\t/* Search a random value in [0..mask] <= max */\n\twhile ((value = (rk_ulong(state) & mask)) > max);\n\n\treturn value;\n}\n\ndouble rk_double(rk_state *state)\n{\n\t/* shifts : 67108864 = 0x4000000, 9007199254740992 = 0x20000000000000 */\n\tlong a = rk_random(state) >> 5, b = rk_random(state) >> 6;\n\treturn (a * 67108864.0 + b) / 9007199254740992.0;\n}\n\nvoid rk_fill(void *buffer, size_t size, rk_state *state)\n{\n\tunsigned long r;\n\tunsigned char *buf = buffer;\n\t\n\tfor (; size >= 4; size -= 4)\n\t{\n\t\tr = rk_random(state);\n\t\t*(buf++) = r & 0xFF;\n\t\t*(buf++) = (r >> 8) & 0xFF;\n\t\t*(buf++) = (r >> 16) & 0xFF;\n\t\t*(buf++) = (r >> 24) & 0xFF;\n\t}\n\t\n\tif (!size) return;\n\n\tr = rk_random(state);\n\n\tfor (; size; r >>= 8, size --)\n\t\t*(buf++) = (unsigned char)(r & 0xFF);\n}\n\nrk_error rk_devfill(void *buffer, size_t size, int strong)\n{\n#ifndef _WIN32\n\tFILE *rfile;\n\tint done;\n\n\tif (strong)\n\t\trfile = fopen(RK_DEV_RANDOM, \"rb\");\n\telse\n\t\trfile = fopen(RK_DEV_URANDOM, \"rb\");\n\tif (rfile == NULL)\n\t\treturn RK_ENODEV;\n\tdone = fread(buffer, size, 1, rfile);\n\tfclose(rfile);\n\tif (done)\n\t\treturn RK_NOERR;\n#else\n\n#ifndef RK_NO_WINCRYPT\n\tHCRYPTPROV hCryptProv;\n\tBOOL done;\n\n\tif (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL,\n\t\tCRYPT_VERIFYCONTEXT) || !hCryptProv)\n\t\treturn RK_ENODEV;\n\tdone = CryptGenRandom(hCryptProv, size, (unsigned char *)buffer);\n\tCryptReleaseContext(hCryptProv, 0);\n\tif (done)\n\t\treturn RK_NOERR;\n#endif\n\n#endif\n\n\treturn RK_ENODEV;\n}\n\nrk_error rk_altfill(void *buffer, size_t size, int strong, rk_state *state)\n{\n\trk_error err;\n\n\terr = rk_devfill(buffer, size, strong);\n\tif (err)\n\t\trk_fill(buffer, size, state);\n\n\treturn err;\n}\n\ndouble rk_gauss(rk_state *state)\n{\n\tif (state->has_gauss)\n\t{\n\t\tstate->has_gauss = 0;\n\t\treturn state->gauss;\n\t}\n\telse\n\t{\n\t\tdouble f, x1, x2, r2;\n\t\tdo\n\t\t{\n\t\t\tx1 = 2.0*rk_double(state) - 1.0;\n\t\t\tx2 = 2.0*rk_double(state) - 1.0;\n\t\t\tr2 = x1*x1 + x2*x2;\n\t\t}\n\t\twhile (r2 >= 1.0 || r2 == 0.0);\n\t\t\n\t\tf = sqrt(-2.0*log(r2)/r2); /* Box-Muller transform */\n\t\tstate->has_gauss = 1;\n\t\tstate->gauss = f*x1; /* Keep for next call */\n\t\treturn f*x2;\n\t}\n}\n\n\n",
                "source_code_before": "/* Random kit 1.3 */\n\n/*\n * Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org)\n *\n * The rk_random and rk_seed functions algorithms and the original design of \n * the Mersenne Twister RNG:\n *\n *   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n *   All rights reserved.\n *\n *   Redistribution and use in source and binary forms, with or without\n *   modification, are permitted provided that the following conditions\n *   are met:\n * \n *   1. Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n *   2. Redistributions in binary form must reproduce the above copyright\n *   notice, this list of conditions and the following disclaimer in the\n *   documentation and/or other materials provided with the distribution.\n *\n *   3. The names of its contributors may not be used to endorse or promote\n *   products derived from this software without specific prior written\n *   permission.\n *\n *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n *   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n *   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n *   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n *   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n * \n * Original algorithm for the implementation of rk_interval function from\n * Richard J. Wagner's implementation of the Mersenne Twister RNG, optimised by\n * Magnus Jonsson.\n *\n * Constants used in the rk_double implementation by Isaku Wada.\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 */\n\nstatic char const rcsid[] =\n  \"@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $\";\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\n#include <time.h>\n#include <limits.h>\n#include <math.h>\n\n#ifdef _WIN32\n/* Windows */\n#include <sys/timeb.h>\n#ifndef RK_NO_WINCRYPT\n/* Windows crypto */\n#ifndef _WIN32_WINNT\n#define _WIN32_WINNT 0x0400\n#endif\n#include <windows.h>\n#include <wincrypt.h>\n#endif\n#else\n/* Unix */\n#include <sys/time.h>\n#include <unistd.h>\n#endif\n\n#include \"randomkit.h\"\n\n#ifndef RK_DEV_URANDOM\n#define RK_DEV_URANDOM \"/dev/urandom\"\n#endif\n\n#ifndef RK_DEV_RANDOM\n#define RK_DEV_RANDOM \"/dev/random\"\n#endif\n\nchar *rk_strerror[RK_ERR_MAX] =\n{\n\t\"no error\",\n\t\"random device unvavailable\"\n};\n\n/* static functions */\nstatic unsigned long rk_hash(unsigned long key);\n\nvoid rk_seed(unsigned long seed, rk_state *state)\n{\n\tint pos;\n\tseed &= 0xffffffffUL;\n\n\t/* Knuth's PRNG as used in the Mersenne Twister reference implementation */\n\tfor (pos=0; pos<RK_STATE_LEN; pos++)\n\t{\n\t\tstate->key[pos] = seed;\n\t\tseed = (1812433253UL * (seed ^ (seed >> 30)) + pos + 1) & 0xffffffffUL;\n\t}\n\n\tstate->pos = RK_STATE_LEN;\n\tstate->has_gauss = 0;\n}\n\n/* Thomas Wang 32 bits integer hash function */\nunsigned long rk_hash(unsigned long key)\n{\n  key += ~(key << 15);\n  key ^=  (key >> 10);\n  key +=  (key << 3);\n  key ^=  (key >> 6);\n  key += ~(key << 11);\n  key ^=  (key >> 16);\n  return key;\n}\n\nrk_error rk_randomseed(rk_state *state)\n{\n#ifndef _WIN32\n\tstruct timeval tv;\n#else\n\tstruct _timeb\ttv;\n#endif\n\n\tif(rk_devfill(state->key, sizeof(state->key), 0) == RK_NOERR)\n\t{\n\t\tstate->key[0] |= 0x80000000UL; /* ensures non-zero key */\n\t\tstate->pos = RK_STATE_LEN;\n\t\tstate->has_gauss = 0;\n\t\treturn RK_NOERR;\n\t}\n\n#ifndef _WIN32\n\tgettimeofday(&tv, NULL);\n\trk_seed(rk_hash(getpid()) ^ rk_hash(tv.tv_sec) ^ rk_hash(tv.tv_usec)\n\t\t^ rk_hash(clock()), state);\n#else\n\t_ftime(&tv);\n\trk_seed(rk_hash(tv.time) ^ rk_hash(tv.millitm) ^ rk_hash(clock()), state);\n#endif\n\n\treturn RK_ENODEV;\n}\n\n/* Magic Mersenne Twister constants */\n#define N 624\n#define M 397\n#define MATRIX_A 0x9908b0dfUL\n#define UPPER_MASK 0x80000000UL\n#define LOWER_MASK 0x7fffffffUL\n\n/* Slightly optimised reference implementation of the Mersenne Twister */\nunsigned long rk_random(rk_state *state)\n{\n  unsigned long y;\n\n  if (state->pos == RK_STATE_LEN)\n\t{\n    int i;\n\n    for (i=0;i<N-M;i++)\n\t\t{\n      y = (state->key[i] & UPPER_MASK) | (state->key[i+1] & LOWER_MASK);\n      state->key[i] = state->key[i+M] ^ (y>>1) ^ (-(y & 1) & MATRIX_A);\n    }\n    for (;i<N-1;i++)\n\t\t{\n      y = (state->key[i] & UPPER_MASK) | (state->key[i+1] & LOWER_MASK);\n      state->key[i] = state->key[i+(M-N)] ^ (y>>1) ^ (-(y & 1) & MATRIX_A);\n    }\n    y = (state->key[N-1] & UPPER_MASK) | (state->key[0] & LOWER_MASK);\n    state->key[N-1] = state->key[M-1] ^ (y>>1) ^ (-(y & 1) & MATRIX_A);\n\n    state->pos = 0;\n  }\n  \n  y = state->key[state->pos++];\n\n  /* Tempering */\n  y ^= (y >> 11);\n  y ^= (y << 7) & 0x9d2c5680UL;\n  y ^= (y << 15) & 0xefc60000UL;\n  y ^= (y >> 18);\n\n  return y;\n}\n\nlong rk_long(rk_state *state)\n{\n\treturn rk_ulong(state) >> 1;\n}\n\nunsigned long rk_ulong(rk_state *state)\n{\n#if ULONG_MAX <= 0xffffffffUL\n\treturn rk_random(state);\n#else\n\treturn (rk_random(state) << 32) | (rk_random(state));\n#endif\n}\n\nunsigned long rk_interval(unsigned long max, rk_state *state)\n{\n\tunsigned long mask = max, value;\n\n\tif (max == 0) return 0;\n\n\t/* Smallest bit mask >= max */\n\tmask |= mask >> 1;\n\tmask |= mask >> 2;\n\tmask |= mask >> 4;\n\tmask |= mask >> 8;\n\tmask |= mask >> 16;\n#if ULONG_MAX > 0xffffffffUL\n\tmask |= mask >> 32;\n#endif\n\n\t/* Search a random value in [0..mask] <= max */\n\twhile ((value = (rk_ulong(state) & mask)) > max);\n\n\treturn value;\n}\n\ndouble rk_double(rk_state *state)\n{\n\t/* shifts : 67108864 = 0x4000000, 9007199254740992 = 0x20000000000000 */\n\tlong a = rk_random(state) >> 5, b = rk_random(state) >> 6;\n\treturn (a * 67108864.0 + b) / 9007199254740992.0;\n}\n\nvoid rk_fill(void *buffer, size_t size, rk_state *state)\n{\n\tunsigned long r;\n\tunsigned char *buf = buffer;\n\t\n\tfor (; size >= 4; size -= 4)\n\t{\n\t\tr = rk_random(state);\n\t\t*(buf++) = r & 0xFF;\n\t\t*(buf++) = (r >> 8) & 0xFF;\n\t\t*(buf++) = (r >> 16) & 0xFF;\n\t\t*(buf++) = (r >> 24) & 0xFF;\n\t}\n\t\n\tif (!size) return;\n\n\tr = rk_random(state);\n\n\tfor (; size; r >>= 8, size --)\n\t\t*(buf++) = (unsigned char)(r & 0xFF);\n}\n\nrk_error rk_devfill(void *buffer, size_t size, int strong)\n{\n#ifndef _WIN32\n\tFILE *rfile;\n\tint done;\n\n\tif (strong)\n\t\trfile = fopen(RK_DEV_RANDOM, \"rb\");\n\telse\n\t\trfile = fopen(RK_DEV_URANDOM, \"rb\");\n\tif (rfile == NULL)\n\t\treturn RK_ENODEV;\n\tdone = fread(buffer, size, 1, rfile);\n\tfclose(rfile);\n\tif (done)\n\t\treturn RK_NOERR;\n#else\n\n#ifndef RK_NO_WINCRYPT\n\tHCRYPTPROV hCryptProv;\n\tBOOL done;\n\n\tif (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL,\n\t\tCRYPT_VERIFYCONTEXT) || !hCryptProv)\n\t\treturn RK_ENODEV;\n\tdone = CryptGenRandom(hCryptProv, size, (unsigned char *)buffer);\n\tCryptReleaseContext(hCryptProv, 0);\n\tif (done)\n\t\treturn RK_NOERR;\n#endif\n\n#endif\n\n\treturn RK_ENODEV;\n}\n\nrk_error rk_altfill(void *buffer, size_t size, int strong, rk_state *state)\n{\n\trk_error err;\n\n\terr = rk_devfill(buffer, size, strong);\n\tif (err)\n\t\trk_fill(buffer, size, state);\n\n\treturn err;\n}\n\ndouble rk_gauss(rk_state *state)\n{\n\tif (state->has_gauss)\n\t{\n\t\tstate->has_gauss = 0;\n\t\treturn state->gauss;\n\t}\n\telse\n\t{\n\t\tdouble f, x1, x2, r2;\n\t\tdo\n\t\t{\n\t\t\tx1 = 2.0*rk_double(state) - 1.0;\n\t\t\tx2 = 2.0*rk_double(state) - 1.0;\n\t\t\tr2 = x1*x1 + x2*x2;\n\t\t}\n\t\twhile (r2 >= 1.0 || r2 == 0.0);\n\t\t\n\t\tf = sqrt(-2.0*log(r2)/r2); /* Box-Muller transform */\n\t\tstate->has_gauss = 1;\n\t\tstate->gauss = f*x1; /* Keep for next call */\n\t\treturn f*x2;\n\t}\n}\n\n\n",
                "methods": [
                    {
                        "name": "rk_seed",
                        "long_name": "rk_seed( unsigned long seed , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "seed",
                            "state"
                        ],
                        "start_line": 112,
                        "end_line": 126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_hash",
                        "long_name": "rk_hash( unsigned long key)",
                        "filename": "randomkit.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 65,
                        "parameters": [
                            "key"
                        ],
                        "start_line": 129,
                        "end_line": 138,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_randomseed",
                        "long_name": "rk_randomseed( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 18,
                        "complexity": 2,
                        "token_count": 138,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 140,
                        "end_line": 166,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_random",
                        "long_name": "rk_random( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 27,
                        "complexity": 4,
                        "token_count": 303,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 176,
                        "end_line": 209,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_long",
                        "long_name": "rk_long( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 17,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 211,
                        "end_line": 214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_ulong",
                        "long_name": "rk_ulong( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 32,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 216,
                        "end_line": 223,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_interval",
                        "long_name": "rk_interval( unsigned long max , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 13,
                        "complexity": 4,
                        "token_count": 92,
                        "parameters": [
                            "max",
                            "state"
                        ],
                        "start_line": 225,
                        "end_line": 245,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_double",
                        "long_name": "rk_double( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 247,
                        "end_line": 252,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_fill",
                        "long_name": "rk_fill( * buffer , size_t size , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 143,
                        "parameters": [
                            "buffer",
                            "size",
                            "state"
                        ],
                        "start_line": 254,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_devfill",
                        "long_name": "rk_devfill( * buffer , size_t size , int strong)",
                        "filename": "randomkit.c",
                        "nloc": 25,
                        "complexity": 7,
                        "token_count": 140,
                        "parameters": [
                            "buffer",
                            "size",
                            "strong"
                        ],
                        "start_line": 276,
                        "end_line": 310,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_altfill",
                        "long_name": "rk_altfill( * buffer , size_t size , int strong , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [
                            "buffer",
                            "size",
                            "strong",
                            "state"
                        ],
                        "start_line": 312,
                        "end_line": 321,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_gauss",
                        "long_name": "rk_gauss( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 23,
                        "complexity": 4,
                        "token_count": 119,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 323,
                        "end_line": 346,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    }
                ],
                "methods_before": [
                    {
                        "name": "rk_seed",
                        "long_name": "rk_seed( unsigned long seed , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 12,
                        "complexity": 2,
                        "token_count": 78,
                        "parameters": [
                            "seed",
                            "state"
                        ],
                        "start_line": 112,
                        "end_line": 126,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 15,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_hash",
                        "long_name": "rk_hash( unsigned long key)",
                        "filename": "randomkit.c",
                        "nloc": 10,
                        "complexity": 1,
                        "token_count": 65,
                        "parameters": [
                            "key"
                        ],
                        "start_line": 129,
                        "end_line": 138,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_randomseed",
                        "long_name": "rk_randomseed( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 18,
                        "complexity": 2,
                        "token_count": 138,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 140,
                        "end_line": 166,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 27,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_random",
                        "long_name": "rk_random( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 27,
                        "complexity": 4,
                        "token_count": 303,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 176,
                        "end_line": 209,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 34,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_long",
                        "long_name": "rk_long( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 4,
                        "complexity": 1,
                        "token_count": 17,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 211,
                        "end_line": 214,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 4,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_ulong",
                        "long_name": "rk_ulong( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 5,
                        "complexity": 2,
                        "token_count": 32,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 216,
                        "end_line": 223,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 8,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_interval",
                        "long_name": "rk_interval( unsigned long max , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 13,
                        "complexity": 4,
                        "token_count": 92,
                        "parameters": [
                            "max",
                            "state"
                        ],
                        "start_line": 225,
                        "end_line": 245,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_double",
                        "long_name": "rk_double( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 5,
                        "complexity": 1,
                        "token_count": 40,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 247,
                        "end_line": 252,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 6,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_fill",
                        "long_name": "rk_fill( * buffer , size_t size , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 17,
                        "complexity": 4,
                        "token_count": 143,
                        "parameters": [
                            "buffer",
                            "size",
                            "state"
                        ],
                        "start_line": 254,
                        "end_line": 274,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 21,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_devfill",
                        "long_name": "rk_devfill( * buffer , size_t size , int strong)",
                        "filename": "randomkit.c",
                        "nloc": 25,
                        "complexity": 7,
                        "token_count": 140,
                        "parameters": [
                            "buffer",
                            "size",
                            "strong"
                        ],
                        "start_line": 276,
                        "end_line": 310,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 35,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_altfill",
                        "long_name": "rk_altfill( * buffer , size_t size , int strong , rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 8,
                        "complexity": 2,
                        "token_count": 48,
                        "parameters": [
                            "buffer",
                            "size",
                            "strong",
                            "state"
                        ],
                        "start_line": 312,
                        "end_line": 321,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 10,
                        "top_nesting_level": 0
                    },
                    {
                        "name": "rk_gauss",
                        "long_name": "rk_gauss( rk_state * state)",
                        "filename": "randomkit.c",
                        "nloc": 23,
                        "complexity": 4,
                        "token_count": 119,
                        "parameters": [
                            "state"
                        ],
                        "start_line": 323,
                        "end_line": 346,
                        "fan_in": 0,
                        "fan_out": 0,
                        "general_fan_out": 0,
                        "length": 24,
                        "top_nesting_level": 0
                    }
                ],
                "changed_methods": [],
                "nloc": 186,
                "complexity": 34,
                "token_count": 1280,
                "diff_parsed": {
                    "added": [
                        "/* static char const rcsid[] =",
                        "  \"@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $\"; */"
                    ],
                    "deleted": [
                        "static char const rcsid[] =",
                        "  \"@(#) $Jeannot: randomkit.c,v 1.28 2005/07/21 22:14:09 js Exp $\";"
                    ]
                }
            }
        ]
    }
]